I want to prepend a couple directories to the $PATH
variable temporarily so that I can set up a temporary development environment that I don't really want to change what other fish sessions see.
So I want to have a setup-env.fish
script that prepends the proper paths to the beginning of $PATH
so that they take precedence.
My simple test is
set -gx tool_dir "/home/jesse/sandbox/tools"
set PATH "$tool_dir/language/bin" $PATH
echo "Evnironment Set up"
I have made sure that those directories exist. When I open a shell and run that script, if I then echo $PATH
that directory does not show up.
I understand that there is a way to persistently add a directory to set -U fish_user_paths path $fish_user_paths
that then prepends to the global $PATH
variable. But I don't want that. If I want to mess around with some different tools, I don't want to much up my system variables. I'd rather just prepend to $PATH
and close the shell if I want. I've read through some of the fish documentation and some github issues about altering $PATH
and I gather there are some variables that are treated differently by fish so I just wasn't sure if I am missing something else here.
If I run those commands in the shell it works, but I want my script to do more and I don't want to type in everything in it.
I am using fish 2.7.1 on XUbuntu 16.04.