You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[fish] make init hook recursion fish compatible (#1771)
## Summary
Hopefully this fix all the fish compatibility issues that were
introduced with the init hook recursion protection. The strategy in this
PR is:
* Wrap init hooks with POSIX and fish compatible wrapper. (no unset
used, only export and dot source)
* Wrap scripts in POSIX compatible wrapper (but not fish).
* The script wrapper will only source init hooks once. The first time it
sources it, the init hook wrapper sets an env var and proceeds to run
the hook. If any command in the init hook is a devbox script, it will
not call init hooks recursively because the env var is set. Once the
init hook is done, it uses `export` to make the var empty. (`export` is
compatible with POSIX and fish, `unset` is not)
* The script wrapper is not fish compatible, but that's OK because
scripts are always run with `sh`. (I think it may be easy to make the
script fish compatible by using `test if we ever decide to support
that).
## How was it tested?
* added `devbox run` calls to init hook
* Shelled in (with zsh and fish)
* Ran scripts
* Tested sourcing `devbox shellenv --init-hook` (with zsh and fish)
0 commit comments