Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for
fish
shell.When running
devbox shell
:We write the post-initialization steps into a "shellrc" file (see
shellrc_fish.tmpl
). I attempted to reuse the existingshellrc.tmpl
, but the differences in syntax between fish and other shells were large enough that I had to separate them. Next, we invokefish -C <shellrc>
. This will makefish
use the user's existing config first, and then run whatever is in<shellrc>
, which is similar to what we do for non-fish shells.When running
devbox run
:sh -c <script>
just like we do for every other shell.fish -C <shellrc> -c <script>
. However, note that Enable unified env by default #650 already enables unified env by default, so this branch is mainly here just in case something goes wrong with unified env and we need to revert.Caveats:
fish
, but it won't for users using a different shell. Similarly for scripts. Conversely, if an init hook uses POSIX syntax that fish doesn't support (e.g.FOO=bar
), then the init hook will fail for fish users.pip
andruby
use init hooks, and they're written in a compatible way (AFAIK).How was it tested?
I tested that both
devbox shell
anddevbox run
worked with and without unified env. I verified thatPATH
was being set, user's config is being run (for shell only), init hooks are being run, history file is set (shell only), prompt is set (shell only), and scripts are written and run.To test with fish, it's as easy as invoking devbox as such: