selectel / pyte

Simple VTXXX-compatible linux terminal emulator
http://pyte.readthedocs.org/
GNU Lesser General Public License v3.0
653 stars 101 forks source link

Konsole clear code missing #80

Closed shaolo1 closed 7 years ago

shaolo1 commented 7 years ago

Under KDE bash clear returns [3J which causes 'interval not defined' error in erase_in_display(3). Any chance of adding this?

see http://stackoverflow.com/questions/5367068/clear-a-terminal-screen-for-real/5367075#5367075

superbobry commented 7 years ago

What is the value of TERM env variable?

VT220 does not support [3J, but xterm does (erase all saved lines). Would it be okay for you if this had been a noop in pyte?

shaolo1 commented 7 years ago

'TERM': 'linux' Locally I patched erase_in_display() from "elif how == 2" to "elif how == 2 or how == 3"

superbobry commented 7 years ago

Hmm, you're right there is indeed a [3J in linux as well:

       The action of a CSI sequence is determined by its final character.

       J   ED        Erase display (default: from cursor to end of display).
                     ESC [ 1 J: erase from start to cursor.
                     ESC [ 2 J: erase whole display.
                     ESC [ 3 J: erase whole display including scroll-back
                                buffer (since Linux 3.0).

In pyte this affects both Screen and HistoryScreen.