From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29448 invoked by alias); 2 Jul 2015 21:47:17 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20300 Received: (qmail 1652 invoked from network); 2 Jul 2015 21:47:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,FSL_HELO_BARE_IP_2, RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.0 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: zzapper Subject: Re: Tip of the day: restoring an aborted command-line Date: Thu, 2 Jul 2015 21:29:35 +0000 (UTC) Organization: Your Company Message-ID: References: <30469.1435788779@thecus.kiddle.eu> X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 95.146.95.151 User-Agent: Xnews/2009.05.01 X-Antivirus: avast! (VPS 150702-2, 02/07/2015), Outbound message X-Antivirus-Status: Clean Oliver Kiddle wrote in news:30469.1435788779@thecus.kiddle.eu: > 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