3 ms·
The reset command should clear the scrollback buffer. On older terminals where you'd get a garbled screen if you accidentally cat a binary file, it will give yo
by djsumdog 7y ago
The reset command should clear the scrollback buffer. On older terminals where you'd get a garbled screen if you accidentally cat a binary file, it will give you your ASCII back.
- swiley 7y agoReset takes at least a couple seconds though, I’m not sure I’d swap it with clear in something like: clear && make test
- jerf 7y agoTrying 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.
- scrollaway 7y agoTried it on konsole 19.12.2 (on Arch), it works for me.
- gerdesj 7y ago[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.
- JdeBP 7y agoYour "gut" is wrong. It's ED 3.
- runlevel1 7y agoIt'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/Ecma-048.pdf http://www.ecma-international.org/publications/files/ECMA-ST... [clear(1)]: http://man7.org/linux/man-pages/man1/clear.1.html#HISTORY http://man7.org/linux/man-pages/man1/clear.1.html#HISTORY EDIT: Fix wording and formatting.
- JdeBP 7y ago... 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 https://unix.stackexchange.com/a/375784/5132 * http://jdebp.uk./Softwares/nosh/guide/commands/setterm.xml http://jdebp.uk./Softwares/nosh/guide/commands/setterm.xml