Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Add execute-command() widget function (was Re: [RFC][PATCH] Add change-directory() widget function)
- X-seq: zsh-workers 48726
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Add execute-command() widget function (was Re: [RFC][PATCH] Add change-directory() widget function)
- Date: Tue, 27 Apr 2021 13:46:12 +0300
- Archived-at: <https://zsh.org/workers/48726>
- In-reply-to: <CAH+w=7ZDorYi2C+0ycysL=99nh_6Mw865H4kB6ZYaHmMZr9tNA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <95CDA630-4EE5-4003-8D9C-CCCB9A47F109@gmail.com> <CAH+w=7bpkYktd4UN5DtUS45MMNdWYr7c-OG7DHOX21QXG4LMUA@mail.gmail.com> <4D587C0C-EB5F-4A58-A0AE-D45E43F432CD@gmail.com> <CAH+w=7bQLq43JChP7PmaqT_wHMwgs4Nk_-0grrtQXEhQJcfrbA@mail.gmail.com> <CAH+w=7ZCzG-BGZuU-rLoZJX=3zcA74NK+TNVDP-CWF-9b-BfrA@mail.gmail.com> <AEC92FEA-6216-4952-818E-9DC7C584698A@gmail.com> <20210421212717.GE21343@tarpaulin.shahaf.local2> <CAH+w=7bFfZucFRj9OZvzTnvxd+QUW7tZHAJiMLi+O0PNjz=wyA@mail.gmail.com> <214AC3E9-FFA5-4F39-A918-562682FE3A3B@gmail.com> <CAH+w=7ZSWhyogP=rn_O40Lc96jTnM4rAKkHaXLn5iOsS7F76Vg@mail.gmail.com> <CAHLkEDspzutwPTAqC7HqdAJDqF0FncsWH6NsHk5Z=bt+Jww8vg@mail.gmail.com> <CAH+w=7ZhNyZypwtMvgBcCkUwCLRzB1+XtccdYG14A1zVJsSTrg@mail.gmail.com> <CAH+w=7YTPm_5=8cPSydgte_Ti7UaihR4s+fOz0H97_4dZwCeiw@mail.gmail.com> <CAHLkEDu4Ac_gRWCuZs24GW84djZ1t7tyVKroAxXrtvWBqUVWqg@mail.gmail.com> <CAH+w=7ZDorYi2C+0ycysL=99nh_6Mw865H4kB6ZYaHmMZr9tNA@mail.gmail.com>
On Tue, Apr 27, 2021 at 12:40 AM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> I would think that occurs with "zle .push-line-or-edit" also?
>
> Anyway, no, there's no way to abort the current ZLE without $?
> becoming nonzero. A lot of effort was put into preserving the value
> of $? across everything that comes in between the previous command
> ending (even if it ended by interrupting ZLE) and the next prompt
> being printed.
>
> I believe you'll see similar things with e.g. edit-command-line from
> the distribution, if it happens to take the branch that calls
> send-break.
In my patch, the last thing done before the widget exits is to set
$BUFFER and call zle .accept-line. The only return value the user will
see in that case is that of the executed command; not that of
.push-line-or-edit. I still prefer that version. Are there drawbacks
to that approach?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author