Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: send-break or EOF exit the shell in "vared"



2020-02-09 08:33:16 +0000, Stephane Chazelas:
[...]
> zsh -c 'vared -c foo; echo $? $foo'
> 
> If I press ^G (send-break widget), that exits the shell (with
> status 0), not just "vared".
[...]

Looks like a regression. That changed in 5.0.8, 5.0.7 was fine.
git bisect points at: https://www.zsh.org/mla/workers/2015/msg00843.html
which was about avoiding syntax error messages upon ^C/^G/push-input.

Setting the "continueonerror" option doesn't help.

doc says:

send-break (^G ESC-^G) (unbound) (unbound)
     Abort the current editor function, e.g.  execute-named-command, or
     the editor itself, e.g.  if you are in vared.  Otherwise abort the
     parsing of the current line; in this case the aborted line is
     available in the shell variable ZLE_LINE_ABORTED.  If the editor is
     aborted from within vared, the variable ZLE_VARED_ABORTED is set.

So it is indeed a bug.

I suppose there's also the question of what push-line,
push-input should do in vared.

-- 
Stephane



Messages sorted by: Reverse Date, Date, Thread, Author