diff --git a/kitty/options/definition.py b/kitty/options/definition.py index fd39d1dce..37c19bebe 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -3282,12 +3282,23 @@ # Scroll the contents of the screen into the scrollback 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 -and clear the screen, instead of just clearing the screen:: +It is also possible to remap Ctrl+L to both scroll the current screen contents +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 ''' )