Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Tip of the day: restoring an aborted command-line
- X-seq: zsh-users 20300
- From: zzapper <david@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Tip of the day: restoring an aborted command-line
- Date: Thu, 2 Jul 2015 21:29:35 +0000 (UTC)
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Your Company
- References: <30469.1435788779@thecus.kiddle.eu>
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