1
I have installed MSYS2. First, I had my HOME in /home/Laurent, / being c:/msys64 in Windows. Then I made different thinks, install Mingw, CMake, and especially msysgit, which has its own MSYS setup. Then when I run a MSYS2 shell, my HOME is now the Windows one: c:/Users/Laurent. Probably I did some weird things.
In /etc/profile, I can read:
# Here is how HOME is set, in order of priority, when starting from Windows
# 1) From existing HOME in the Windows environment, translated to a Posix path
# 2) from /etc/passwd, if there is an entry with a non empty directory field
# 3) from HOMEDRIVE/HOMEPATH
# 4) / (root)
So it seems that my MSYS2 has "switched" to the default HOME (1). Here is /etc/passwd concerning my account:
Laurent:unused:1001:513:U-Win7\Laurent,S-1-5-21-1379731639-3004223336-974672684-1001:/home/Laurent:/bin/bash
Shall I replace it with:
Laurent:unused:1001:513:S-1-5-21-1379731639-3004223336-974672684-1001:/home/Laurent:/bin/bash
to restore my initial setup ? I am not sure of the syntax of this line which is not familiar to what I know from standard Linux distributions, and I would not like to mess my setup and possibly loose my shell history.
I tried my own suggestion after doing a backup, it does not work. – lalebarde – 2014-03-18T11:03:22.380
I have discovered that the Windows environment variable HOME is used by
/etc/profile. So I have modified it toc:/msys64/home/Laurentand it works. Surprisingly,pwdreturns/usr/home/Laurentinstead of/home/LaurentI expected. /usr exists in the shell, but is not in Windows Explorer. Besides,/and/usrare identical like if/usrwas a soft link to/- touching a file is repercuted in the other and in c:\msys64. – lalebarde – 2014-03-18T11:41:31.760The msysgit home was not affected. Its /etc/profile does not manage HOME the same way. I think it works because it has not permissions on the MSYS2 tree, but I am not sure. – lalebarde – 2014-03-18T12:04:35.007