Hacker News new | past | comments | ask | show | jobs | submit login

Trying it just now on konsole, it does not. Whether that's because your terminal is following standards or because your terminal is interpreting a terminal command that doesn't actually say anything about scrollback to also clear scrollback, I don't know, and await anyone who does to answer that question.

My gut is that the terminal protocol would know nothing about scrollback and thus not have a "clear scrollback" command in it directly. There are plenty of other indications that scrollback is basically a hack.




[Konsole] Settings -> Configure Keyboard Shortcuts ... "Clear Scrollback and Reset". On my Arch boxes it is mapped to Ctrl + Shift + k. That's probably a default from upstream.


Tried it on konsole 19.12.2 (on Arch), it works for me.


Your "gut" is wrong. It's ED 3.


It's a common feature, but not formally standardized.

ED 3 isn't actually in the [ECMA-048] spec.

It was an xterm feature introduced in June 1999. Several terminal developers later adopted the feature. In April 2011, a Red Hat developer submitted a patch to the Linux kernel, modifying its console driver to do the same thing.

So it's not a formal standard, but it's universal on Linux since 3.0 and many terminal emulators have adopted it.

This history is covered in [clear(1)] from the ncurses project.

[ECMA-48]: http://www.ecma-international.org/publications/files/ECMA-ST...

[clear(1)]: http://man7.org/linux/man-pages/man1/clear.1.html#HISTORY

EDIT: Fix wording and formatting.


... none of which contradicts the point that the protocol does know about scrollback. The aforementioned developer, Petr Písař, got the implementation wrong, note.

* https://unix.stackexchange.com/a/375784/5132

* http://jdebp.uk./Softwares/nosh/guide/commands/setterm.xml




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: