Can someone please tell me what\'s the correct way to set a bunch of environment variables in the fish shell?
In my .config/fish/config.fish file, I have a function to s
If the variable has to be shared between all the current user fish instances on the current computer and preserved across restarts of the shell you have to use -U
or --universal
:
set -Ux FOO bar
Using set
with -g
or --global
doesn't set the variable persistently between shell instances
Note:
Do not append to universal variables in config.fish
file, because these variables will then get longer with each new shell instance. Instead, simply run set -Ux
once at the command line. And it will be stored in the file .config/fish/fishd.MACHINE_ID
, where MACHINE_ID
is typically your MAC address.