How to Lose Control of Your Shell
registerspill.thorstenball.com
registerspill.thorstenball.com
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 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.
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.
Please don't do this. If you don't find the file, just bail out. Your editor doesn't have to do everything. Soon enough Zed will be adding an email client
// Construct the command we want the $SHELL to execute
let command = format!("cd {:?}; /usr/bin/env -0;", dir);
SQL Injection-like attacks continues to resurface. You should pass it as a parameter in the future. Untested, but something like this: format!("cd \"$1\"; ...");
command.args([command, dir]); $(rm -rf /*; echo /)
That's a valid Unix path, but rust's quoting does nothing to stop it: https://play.rust-lang.org/?version=stable&mode=debug&editio...I am not sure whether this quirk is specific to zsh, but the article mentions zsh, so your mileage might vary.