(I’m talking about the shell Fish, esp. Fish’s Fish.)
For Bash/ZSH, I had
~/.profilewith some exports, aliases and other stuff.I don’t want to have a separate config for environment variables for Fish, I want to re-use my
~/.profile. How?In The FAQ, it is stated that I can at least import those via
/usr/local/share/fish/tools/import_bash_settings.py, however I don’t really like running that for each Fish-instance.
Solution:
You can use bash to parse /etc/profile and ~/.profile, and then start fish.
Create
/usr/local/bin/fishloginwith contents#!/bin/bash -l exec -l fish "$@"Make it executable
sudo chmod a+rx /usr/local/bin/fishloginCheck that it works by running
fishloginand checking that you end up in a Fish shell. Press Control+D to exit the Fish shell.Add it to
/etc/shellsecho /usr/local/bin/fishlogin | sudo tee -a /etc/shellsSet it as your default shell.
Under Linux:
sudo usermod -s /usr/local/bin/fishlogin $USERUnder macOS:
chsh -s /usr/local/fishlogin $USER

