Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: clearing the screen without losing anything?



On 16/01/2008, Andy Spiegl <zsh.Andy@xxxxxxxxx> wrote:
> I was just wondering whether it's possible to clear the screen (with Ctrl-l)
> such that the screen contents is pushed into the terminal's (i.e. xterm)
> scrollback buffer.
>
> Uhm, I am not even sure whether that's a zsh or xterm issue?
>
> Thanks,
>  Andy.

You can create a custom widget that echos some blank lines, and then
clears the screen.

function myclear() {zle -I;repeat $((LINES-2)) echo;clear}
zle -N myclear
bindkey '^L' myclear

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author