Bug 455500 - `printf "\ec"` does not clear the previous lines
Summary: `printf "\ec"` does not clear the previous lines
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: history (show other bugs)
Version: 22.12.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-17 17:05 UTC by b2.temp
Modified: 2024-02-26 01:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description b2.temp 2022-06-17 17:05:48 UTC
SUMMARY

`printf "\ec"` does not clear the previous lines, they are simply hidden.

STEPS TO REPRODUCE
1. open konsole
2. type ENTER as long a necessary to have the scollbars displayed
3. type `printf "\ec"`

OBSERVED RESULT

It is still possible to see the previous prompts

EXPECTED RESULT

it should not be possibke scroll back
Comment 1 Matan Ziv-Av 2022-06-17 18:33:44 UTC
This behavior (I am not sure it is a bug), is the result of https://invent.kde.org/utilities/konsole/-/merge_requests/589
reset() uses scrollUp(0, _cuY) to clear the screen, which after this commit saves all lines to the scroll back buffer.

In the current development branch, the screen is cleared by clearEntireScreen() instead, so the behavior is more similar to the old behavior (tough not exactly the same).
Comment 2 b2.temp 2022-08-25 07:59:20 UTC
maybe is there another command that does it right ?

actually I use `printf "\ec"` because it's easy to remember.
Comment 3 ninjalj 2024-02-26 01:11:18 UTC
clear from the ncurses package by default clears the screen and the scrollback buffer.