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

Re: Tip of the day: restoring an aborted command-line



Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote in
news:30469.1435788779@xxxxxxxxxxxxxxxx: 

> When you abort a command-line with Ctrl-C or whatever, the Zsh line
> editor sets $ZLE_LINE_ABORTED to the contents of the command-line
> before it was aborted. Sometimes you might want to recover the aborted
> line and you could bind a dedicated key to that purpose. The following

> 
>   zle-line-init () {
>     if [[ -n $ZLE_LINE_ABORTED ]]; then
>       local savebuf="$BUFFER" savecur="$CURSOR"
>       BUFFER="$ZLE_LINE_ABORTED" 
>       CURSOR="$#BUFFER" 
>       zle split-undo
>       BUFFER="$savebuf" CURSOR="$savecur" 
>     fi
>   }

> Oliver
is $ZLE_LINE_ABORTED dependent on any autoload? as i have it on cygwin
but not on centos (both 5.08) 



-- 
zzapper
https://twitter.com/dailyzshtip

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus




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