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

Re: [PATCHv2] [bug] $SHLVL decremented for the last command of a subshell



On Tue, 30 Aug 2016 13:44:26 +0100
Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> 2016-08-29 18:55:05 -0700, Bart Schaefer:
> > On Aug 29,  4:51pm, Stephane Chazelas wrote:
> > }
> > } I think the change below should be enough (also condensed the 2
> > } "if"s below (unrelated)):
> > 
> > This looks fine, although I think we generally keep the braces on the
> > "if" body whenever there is more than one line following -- even if
> > some of those lines are comments.
> > 
> > Either that or move the comment above the "if".
> 
> How about this (factorised the !subsh some more comments and
> added some test cases):

This is probably fine.  I've been dithering over cases where for
consistency we might want to decrement SHLVL even in a subshell because
we're exec'ing for some other reason (so would need to do it at the last
minute before exiting if the exec is faked), but I suspect this is too
obscure to be worth special treatment.

pws



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