Globally sets HOME affecting third-party applications (GNU Emacs)
By pattho... on May 15, 2009 09:39 (imported from Google Code)
What steps will reproduce the problem?
- The HOME environment variable exists for all applications launched by
Windows explorer.
What is the expected output? What do you see instead?
This variable shouldn't be set for child processes that are not Git.
What version of the product are you using? On what operating system?
0.6.2.0 with git 1.6.3.msysgit.0 on Windows Server 2008 x64
Please provide any additional information below.
I use GNU Emacs as my editor and have a specific .emacs that lives in
c:\Users\pat\AppData\Roaming.emacs which seems to be where emacs considers
~/.emacs to be. I can see that most applications are storing their
configuration data in this location on Vista style systems.
Following installation of TortoiseGit 0.6.2.0 my .emacs file is no longer
being read leading to a misconfigured system. This is because there is now
a HOME environment variable defined in the launching process (either
Explorer itself or a cmd shell launched from explorer). This is set to
C:\Users\pat (ie the same as USERPROFILE) where it probably should be using
the value of APPDATA (or the Win32 API call that is the real source of
this). Emacs is now making use of this instead of the original location
because HOME is treated as an override of the system default location.
I recognise that no-one is too sure where HOME really should be on recent
windows systems. %USERPROFILE% and %HOMEDRIVE%%HOMEPATH% would seem to be
likely but as I understand it someone should be calling SHGetFolderPath
with CSIDL_APPDATA which is what emacs is doing in
src/w32.c:init_environment to configure the default value of HOME.