Any variable that I declare in my zshrc is available in the shell as an environment variable. I don’t want this to happen.
I tried putting the variables in a function and setting them as local, but then the function is available outside of the zshrc.
How can I make it so what happens in my zshrc stays in my zshrc?
They are available, but they are not exported so scripts launching from command-line don’t get these variables. If your
.zshrclooks likeand you then never want to launch
zshrcfunction again you can just doafterwards.