|
From: LRN <lr...@gm...> - 2011-03-29 11:30:32
|
msysCORE's default /etc/profile ends with this line: cd "$HOME" Would it be a good idea to make it conditional (i.e. profile only cds into $HOME if some convolutely-named environment variable is set to something non-empty)? If you want users to go into $HOME by default, you might as well set the right env.variable in msys.bat (which is, i think, what 95% of msys users run to get into msys). cd'ing into $HOME prevents external processes (non-msys processes) from running msys shell in login mode (well, it doesn't really prevent that - but current directory changes, and if an external process passed a command along (it usually does), it gets executed in the wrong directory). Running in non-login mode is not a good option, because it skips /etc/profile - which means that the resulting shell doesn't have correct PATH, HOME, MAKE_MODE variables etc. ALSO Msys sets $HOME (if empty) to "/home/$LOGNAME" Msys^Wmingw-git sets $HOME (if empty) to "$HOMEDRIVE$HOMEPATH" or (if that is empty or doesn't exist) to "$USERPROFILE", and then msysizes it by setting $HOME to "$(cd "$HOME" ; pwd)" Personally i like the way it is in msys (/home/*/ makes it close, simple and easy), but msys^Wmingw-git has a point as well - if someone has multiple msys installations in space (i.e. simultaneously) and/or time (over the course of time), that someone might value the fact that the contents of the $HOME directory do not change from msys to msys. Msys^Wmingw-git also do it because they have some kind of shell extension that `runs git-bash from here' and requires CD to be preserved. What do you think? ALSO /etc/profile is overwritten by each new msysCORE upgrade, AFAIU. How does one make global (per-user changes can be made with per-user shell config, i think) shell changes in such circumstances? Some packages might want to change it as well. A possible way to do that is to write these changes (by these packages) into /etc/profile, but make them conditional. I guess it depends on the nature of these changes. But releasing a new msysCORE version just because something in /etc/profile has to be changed is definitely not good. |