I use Cygwin on Windows 7. I'm not really a Windows user, so it's already a little inconvenient for me to have to have this extra layer in between my OS and Zsh, my shell of choice.
Now, I frequently have to change my PATH in Windows. The one you change via the advanced system preferences. However, I've noticed that this PATH change does not propagate to Zsh under Cygwin.
Very well, so I look in .zshrc
, and I find:
# User configuration
export PATH="/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/Intel/iCLS Client:/cygdrive/c/Program Files/Intel/iCLS Client:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Windows Live/Shared:/cygdrive/c/Program Files (x86)/Intel/OpenCL SDK/3.0/bin/x86:/cygdrive/c/Program Files (x86)/Intel/OpenCL SDK/3.0/bin/x64:/cygdrive/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/cygdrive/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/cygdrive/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/cygdrive/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/cygdrive/c/Program Files/ffmpeg/bin"
# export MANPATH="/usr/local/man:$MANPATH"
I did not add that (well, maybe the ffmpeg
bit at the end). Where does it come from? Does Cygwin set this up initially when it installs Zsh? Does Oh-my-zsh figure this out somehow? Somehow it must've known my PATH at some point and added that to my .zshrc
.
The Cygwin FAQ says,
All Windows environment variables are imported when Cygwin starts
But that does not seem to be the case—or the export PATH
declaration in the .zshrc
overwrites whatever Cygwin does.
Needless to say, I'm very confused. So here's the question:
When I edit my Windows PATH, what is the recommended way of telling a Cygwin shell that it has changed? Do I need to always edit my shell profile manually? Or can this be auto-generated?