Bug 158235 - Add support for xterm CSI 3 J sequence
Summary: Add support for xterm CSI 3 J sequence
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-22 18:28 UTC by Matthew Woehlke
Modified: 2018-06-07 13:48 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 Matthew Woehlke 2008-02-22 18:28:24 UTC
Version:           2.1 (using Devel)
Installed from:    Compiled sources
OS:                Linux

While looking at http://rtfm.etla.org/xterm/ctlseq.html (mentioned in bug #158905), I noticed the '3' variant of the clear sequence CSI # J, which is described as "Erase Saved Lines". That sounds a whole lot like "clear history", and sure enough, in xterm that's what it does.

I know Konsole has the new 'send commands via escape sequences' thing, but that has the disadvantage of a: being very long to type, and b: clear history must be done by disabling history and re-enabling (which means if you had it on 'unlimited' and change it "back" to fixed... oops).

How about recognizing CSI 3 J (a.k.a. '\e[3J' a.k.a. '^[[3J') ala xterm?
Comment 1 Robert Knight 2008-03-18 16:45:43 UTC
SVN commit 787067 by knight:

Add support for xterm's CSI 3 J control sequence to clear the history.

BUG: 158235


 M  +1 -0      Vt102Emulation.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=787067
Comment 2 Piotr Dobrogost 2016-10-26 15:56:55 UTC
How can one enter this escape sequence?
Comment 3 Kurt Hindenburg 2016-11-08 20:03:56 UTC
print '^[[3J'  where the ^[ are one character - hit Ctrl+v and then ESC to generate it.


It seems to work as xterm which both print a ' which is strange.
Comment 4 Piotr Dobrogost 2016-11-09 08:43:53 UTC
(In reply to Kurt Hindenburg from comment #3)
> print '^[[3J'  where the ^[ are one character - hit Ctrl+v and then ESC to
> generate it.

Thanks for reply. I tried this but got the following error:
bash: print: command not found
 
> It seems to work as xterm which both print a ' which is strange.

This I don't understand.
Comment 5 Ahmad Samir 2018-06-07 13:48:13 UTC
(In reply to Piotr Dobrogost from comment #4)
[...] 
> Thanks for reply. I tried this but got the following error:
> bash: print: command not found
>  

FTR, what you need to do is send that escape sequence to the terminal, e.g. using printf or echo:
printf '\e[3J'
echo -e '\e[3J'

alternatively you can use the menu, View -> Clear Scrollback.