From 9a86184a45029e68ebf3d85840f4807df0de418d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 7 Jun 2021 09:35:08 +0530 Subject: [PATCH] Add a note about binding ctrl+l to scroll and clear instead of just clear --- kitty/options/definition.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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 @@ You can create shortcuts to clear/reset the terminal. For example:: # 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 ''' )