Bug 455500

Summary: `printf "\ec"` does not clear the previous lines
Product: [Applications] konsole Reporter: b2.temp
Component: historyAssignee: Konsole Developer <konsole-devel>
Status: REPORTED ---    
Severity: normal CC: matan, ninjalj
Priority: NOR    
Version: 22.12.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

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.