Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ZLE_LINE_ABORTED: how to restore the last non-blank aborted line?
- X-seq: zsh-users 21990
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Hong Xu <hong@xxxxxxxxxx>
- Subject: Re: ZLE_LINE_ABORTED: how to restore the last non-blank aborted line?
- Date: Thu, 29 Sep 2016 09:50:59 +0200
- Cc: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TLv+cIeHzgNlfnRMKiHs5O12jJ+cVNkanZChxGcy1ng=; b=quJ/3TAeVZvL3F8NkUVxMh9C9vIeBEnlQl2ktsfMlPTA6B53WdlXVBFI5pgXu3feGU u8Itu0TbLlqCiHgbTOA83Gw78cP+WvnszCrl9zJLf4DerYO1xuNg8izW/+P6cpSIZtGD usCYjcok/oAHeiNYkqreOE26dqXVkL5cZdPPlGZUMGCgW520ZBHk2hZJgrB7Bar8spBm WD69RKAaSFTwd2zjVSq4/dxxWFWZEHxS5LRJxnBQo8ykYRMu8jCi4cAexT0cuNWUOoeJ 2Y982rt+3MhxvmWotr9YCVqVpd75Bo0UMQlW/MyDxDcWhbpYnJHsURVOcT4/nWAg6y+J 4qHQ==
- In-reply-to: <e5f293ed-a4a8-a2e2-0d25-1156144534bd@topbug.net>
- 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
- References: <ed1737fc-2336-dc0c-2f43-a2d2dc178bef@topbug.net> <160929001257.ZM27763@torch.brasslantern.com> <e5f293ed-a4a8-a2e2-0d25-1156144534bd@topbug.net>
On Thu, Sep 29, 2016 at 9:32 AM, Hong Xu <hong@xxxxxxxxxx> wrote:
> On 09/29/2016 12:12 AM, Bart Schaefer wrote:
>> On Sep 27, 9:11pm, Hong Xu wrote:
>> }
>> } ZLE_LINE_ABORTED would turn empty if ^C is pressed on an empty line
>> } disregarding what it was. This is annoying since sometimes auto
>> } completion stuck and more than one ^C is used to cancel that.
>> }
>> } Is there any way to preserve it in this case in zsh?
>>
>> Can you give a more specific example? Normally any buffer preceding
>> the line on which the abort occurred is already in the history and can
>> be recalled with up-line-or-history et al.; ZLE_LINE_ABORTED is only
>> needed to capture lines that haven't yet been added to history.
>>
>
> Sure. For example,
>
> emacs path/to/some/file
>
> Now assume that the tab completion stucks at this point and the user
> accidentally presses two ^C to cancel that. Now, ZLE_LINE_ABORTED is
> empty but the user would prefer to restore the line "emacs
> path/to/some/file".
You can have your zle-line-init hook record the value of
$ZLE_LINE_ABORTED in $HONG_XU_LINE_ABORTED and only do so if
$ZLE_LINE_ABORTED is non-empty.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author