Add an action to the `clear_terminal` function to scroll the screen contents into the scrollback buffer

Now if you want to map a key combination that will both scroll the
current screen contents into the scrollback buffer and clear the screen,
you can do something like:

map ctrl+l combine : clear_terminal scroll active : send_text normal,application \x0c

Fixes #1113
This commit is contained in:
Kovid Goyal
2018-11-03 14:18:09 +05:30
parent a958cabf01
commit fc3bd2d15f
4 changed files with 23 additions and 2 deletions
+3
View File
@@ -373,6 +373,9 @@ class Boss:
reset = action == 'reset'
how = 3 if action == 'scrollback' else 2
for w in windows:
if action == 'scroll':
w.screen.scroll_until_empty()
continue
w.screen.cursor.x = w.screen.cursor.y = 0
if reset:
w.screen.reset()