3 ms·
I had to abandon the last time I tried fish because it’s not compatible with my export PATH declarations from tooling in bash/zsh, any tips?
by pacifika 3y ago
I had to abandon the last time I tried fish because it’s not compatible with my export PATH declarations from tooling in bash/zsh, any tips?
- artemisart 3y agoJust rewrite them once with fish_add_path? https://fishshell.com/docs/current/tutorial.html#path https://fishshell.com/docs/current/tutorial.html#path Or maybe use https://github.com/edc/bass https://github.com/edc/bass
- PufPufPuf 3y agoYou can source bash files (like .bashrc) using the plugin "bass". You can also launch fish using a bash file, just export the variables and run fish as the last command. I personally just put what path modifications I need in .profile and have fish as my login shell.
- bin_bash 3y agoOK so if you're new to fish you should understand universal variables since it's a concept that bash/zsh does not have and it's actually pretty great. When people first try out fish they want to add their global env vars and PATH configuration to ~/.config/fish/config.fish. You can absolutely do this similar to how you do it in ~/.bashrc. However, it's not idiomatic and once you get used to universal variables, you'll see that it's a lot of yak shaving you really just don't need editing config.fish. Instead, if you want to permanently set an env var across the current session and all new sessions, run: `set -Ux MY_ENV_VAR 1` (set a universal variable, and export it to subprocesses) That will put it into a machine-readable file ~/.config/fish/fish_variables. You can open it if you want but this way you don't need to source your rc files, open a new shell, or even open your editor. For PATH, just run: `fish_add_path ~/my-new-bin`. It uses universal variables by default. For some reason I avoided universal variables as much as possible for years using fish and now I think that was really silly.
- Flimm 3y agoI think later versions of Fish do support export statements. This line of code works with Fish, as well as Bash and Zsh: export PATH="$PATH:$HOME/foobar/"