> Now, listen. I wish I could continue here and end with “… and this is why ZSH does it that way!”
https://github.com/zsh-users/zsh/blob/47c7bc9b1493c7374f076b... has a comment about this behaviour, but no justification. I think it's just an optimization to save a little bit of time by not forking, and to avoid having the zsh process hanging around taking resources for no reason.
I wonder if restoring the process leader before doing the exec would work out okay, or if that's just going to end up being differently confusing.
I suspect, on the whole, this was a clever idea in theory with unfortunate consequences in practice (much like most of my clever ideas) and would be better just being reverted.
However, I'm not usually a zsh user myself so I'm loath to file a bug given there may be actual zsh users out there who like/rely on this behaviour.
> However, I'm not usually a zsh user myself so I'm loath to file a bug given there may be actual zsh users out there who like/rely on this behaviour.
That sounds like reason for a “won’t fix” response more than a reason not to file the bug in the first place. If nothing else it provides an opportunity to explain why it is the way it is.
https://github.com/zsh-users/zsh/blob/47c7bc9b1493c7374f076b... has a comment about this behaviour, but no justification. I think it's just an optimization to save a little bit of time by not forking, and to avoid having the zsh process hanging around taking resources for no reason.