Zsh Mailing List Archive
Messages sorted by:
Re: Aborted command saved in history
- X-seq: zsh-workers 37823
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: Aborted command saved in history
- Date: Wed, 27 Jan 2016 23:26:05 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=3tlblZ42j/NWdh+US8e/yITOwJfdxXsr95bu7CRSfhg=; b=YkWBABc6mzTnxxHo2QjrOdUSkW0SyrT6eOPV8zVMuXNQfs57GfZ83/jqz279jzPwVW 2BPcJ2axhh+fnmozmqrUkbu9XzhMVX5a8e6S0uj9scQWRTJ3mqCkoLHQB9oqSvURNdUy sUuUsycTaOUSQSC9EIzJ4vo+RYcS8kJYtFK3nb6nSqitF5ECxQN9bmfVwjPPD6ZB3xU5 8doPvUSpILYdE/BbNxWBcQR1X9QwSKAqsYPOohn9HX0KLIndQTA0zStKS7yk2FjX/JKd tCTxXw6F0vPysQ8bRHB8R6ccpt2szjZpmOYGwjPzZpvEQIhFMemz/kW6RBmhEhl3tODh OAUA==
- In-reply-to: <CAHYJk3Q5BP01QvXi1qE1yME7irNOoqXa8BhxXZb+HpDXRUyggA@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHYJk3TY-JsahHgYWJSe_knx0Xo6D9ecXiTJQ=w+aUTDGHOT8A@mail.gmail.com> <160127214510.ZM2878@torch.brasslantern.com> <CAHYJk3Q5BP01QvXi1qE1yME7irNOoqXa8BhxXZb+HpDXRUyggA@mail.gmail.com>
On Jan 28, 7:56am, Mikael Magnusson wrote:
} Is it expected that the line is saved [on keyboard interrupt]
} at all though? If you do a get-line and then ctrl-c twice, it is not
} saved, so a possible argument that "you accepted the first part of the
} line when you pressed enter" seems a bit weak to me.
The decision is made based on whether the parser returned anything. In
the PS2 prompt case, the parser was invoked upon the first accept-line,
whereas in the get-line case the parser was never invoked at all.
This is how it has always worked (and I believe also how history is
handled in csh, whence this is all derived) but I'm not averse to
someone investigating how to change it. I just don't plan to do so
Incidentally ZLE_LINE_ABORTED only gets the part that hasn't already
been through the parser, e.g. from the PS2 prompt in the first example.
If we remove the "prebuffer" from the history, we should put it into
ZLE_LINE_ABORTED instead. Although I suspect that might confuse some
uses of ZLE_LINE_ABORTED.
} Usually when I get a continuation prompt it's because I mistyped
} something, so I press ctrl-c to get out of the continuation and then
} retrieve it with uparrow and try again.
Incidentally this is exactly what push-line-or-edit is for, and is
very nearly what it does.
Messages sorted by: