Add a note about binding ctrl+l to scroll and clear instead of just clear
This commit is contained in:
parent
00828cb804
commit
9a86184a45
@ -3282,12 +3282,23 @@ You can create shortcuts to clear/reset the terminal. For example::
|
|||||||
# Scroll the contents of the screen into the scrollback
|
# Scroll the contents of the screen into the scrollback
|
||||||
map kitty_mod+f12 clear_terminal scroll active
|
map kitty_mod+f12 clear_terminal scroll active
|
||||||
|
|
||||||
If you want to operate on all windows instead of just the current one, use :italic:`all` instead of :italic:`active`.
|
If you want to operate on all windows instead of just the current one, use
|
||||||
|
:italic:`all` instead of :italic:`active`.
|
||||||
|
|
||||||
It is also possible to remap Ctrl+L to both scroll the current screen contents into the scrollback buffer
|
It is also possible to remap Ctrl+L to both scroll the current screen contents
|
||||||
and clear the screen, instead of just clearing the screen::
|
into the scrollback buffer and clear the screen, instead of just clearing the
|
||||||
|
screen, for example, for ZSH add the following to :file:`~/.zshrc`:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
scroll_and_clear() {
|
||||||
|
printf '\\n%.0s' {1..$(tput lines)}
|
||||||
|
printf '\\e[H\\e[2J'
|
||||||
|
zle redisplay
|
||||||
|
}
|
||||||
|
zle -N scroll_and_clear
|
||||||
|
bindkey '^l' scroll_and_clear
|
||||||
|
|
||||||
map ctrl+l combine : clear_terminal scroll active : send_text normal,application \\x0c
|
|
||||||
'''
|
'''
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user