Another bash example (expecting to still be in the original dir when it's done):
(cd subdirectory && command --that might.fail) && run --command-in-original-dir --only-if-subshell-succeeded
I think that spawning another process would be inefficient. Maybe we could just spawn a thread. There are things that would need to be isolated/preserved:
cwd
env variables
variables in current scope?
classpaths and required libraries?
It might be worth considering to do the isolation with boot pods.
Example of subshell in bash:
Possible alternative in closh:
Another bash example (expecting to still be in the original dir when it's done):
I think that spawning another process would be inefficient. Maybe we could just spawn a thread. There are things that would need to be isolated/preserved:
It might be worth considering to do the isolation with boot pods.
There are other useful suggestions in https://github.com/fish-shell/fish-shell/issues/1439.