After some head-scratching I now have flox running by default in my Ubuntu terminal. Previously I had fish (installed via apt) as my default shell and this seemed to cause problems. To resolve this I:
uninstalled fish from Ubuntu
reset my default shell to bash
created a default flox environment
added flox activate to .bashrc
I have also run flox install fish in my default environment so which fish returns:
/home/user/.cache/.../bin/fish
And I can manually run fish to launch the fish shell. Now I want to make fish my default flox shell.
I follow up on that route in the other post. Although in this scenario, I wouldnât bother installing fish on the base system and instead live in flox prompts powered by fish.
when running $(flox activate) flox will output a script suitable for the executing shell or, as in this case, FLOX_SHELL.
Effectively, eval "$(FLOX_SHELL=fish flox activate -r my/default)" in a bash shell, will result in flox outputting a fish script which is then evaluated by bashs eval i.e. as a bash script.
Since both shell dialects are not compatible you get bash errors.
I guess you could run something like FLOX_SHELL=fish exec flox activate -r my/default as the last thing in your bashrc. that would at least get you out of the nesting
bash > flox > fish
Whether one should do this is another question, considering the side effects that would have on other uses of bash expecting bashrcs to leave you in a bash shellâŚ
Indeed. I also ran into âThe file specified the interpreter â/bin/fishâ, which is not an executable command.â when trying to run a fish script, since /bin/fish no longer exists. I think I will leave this question of bootstrapping fish within flox for another day, and just use the system-provided version of fish.
Now whenever you launch a terminal, you should be in fish, and you should be able to run flox activate. To make it automatic, add the following line to $HOME/.config/fish/config.fish:
eval (flox activate --dir=$HOME) | source
Now whenever you launch a terminal, you should be in fish and your default environment should be activated (run flox list to confirm). And you can install all other tools with flox.
Also confirmed in gnome-system-monitor that I donât have a chain of shells.