A new escape code that moves the current contents of the screen into the scrollback before clearing it

This commit is contained in:
Kovid Goyal
2023-05-09 09:32:39 +05:30
parent 8f15654985
commit e72975cc98
3 changed files with 30 additions and 3 deletions

View File

@@ -3997,8 +3997,7 @@ clearing the screen, for example, for ZSH add the following to :file:`~/.zshrc`:
.. code-block:: zsh
scroll-and-clear-screen() {
printf '\\n%.0s' {1..$LINES}
zle clear-screen
printf "\e[H\e[22J"
}
zle -N scroll-and-clear-screen
bindkey '^l' scroll-and-clear-screen