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

Re: zle clear-screen, exit status



2010/10/19 Brian Lewis <brian@xxxxxxxx>:
> On Tuesday, 19.10.10 at 17:47, JÃrÃmie Roquet wrote:
>> bindkey -s "^L" "clear\n"
>> is enough :)
>
> That's not quite as good as zle clear-screen:
>
> $ asdf^Lclear
> zsh: command not found: asdfclear
>
> Also, if I were to do
> BUFFER='clear'
> zle accept-line
>
> it would reset $?, but it destroys the line I was editing when I hit
> Ctrl-L.

Oh right :s

Then I don't know if there is a way to do it from a zle widgetâ but:

I have this in my conf:
  bindkey '^[p' push-input

It allows me to clear the command line with ctrl+p, type a command,
and restore the cleared command line when validating.

Then I just have to add:

bindkey -s "^L" "^[pclear\n"

And now it doesn't destroy anything. Well, actually, it does destroy
the pushed line.
Of course, it's not a very elegant solution.

Best regards,

-- 
JÃrÃmie



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