0
When I start cygwin, my ~ dir is the same as $HOME. After some time, ~ dir changs, while $HOME stays the same. I am puzzled by this, not sure where to look. Maybe someone experienced this, or has some clue what's going on? When I start:
winuser@mybox ~
$ echo $HOME
/cygdrive/c/cyguser
winuser@mybox ~
$ echo ~
/cygdrive/c/cyguser
Later, ~ changes to /cygdrive/c/winuser, which is non-existent. When I restart cygwin, everything is back to normal. What could be causing this?
1The
~
character is expanded to the value of$HOME
by the bash shell. The only time this won't happen is if$HOME
is not set; then it's expanded to the home directory of the current user, but that's not consistent with what you're describing. Please show us (copy-and-paste) the output ofecho \~ = ~, HOME = $HOME, USER = $USER, \~winuser = ~winuser
. And normally your home directory should be/home/winuser
; why and how did you change it? – Keith Thompson – 2012-04-03T18:58:15.727@Keith I set HOME under user section of environment variables dialog. It is set to
C:\cyguser
. I am waiting for the problem to reoccur. Currently:~ = /cygdrive/c/cyguser , HOME = /cygdrive/c/cyguser, USER = winuser, ~winuser = /home/winuser
. Thanks for looking into this. – user443854 – 2012-04-03T21:03:03.080Whatever is causing this behavior (
~
and$HOME
should be the same), I think you'll be better off using the default settings, with your Cygwin home directory set to/home/username
. If you want your Cygwin home directory to be directly underC:\
for some reason, you can make/home/username
. The inconsistency betweencyguser
andwinuser
is also confusing. – Keith Thompson – 2012-04-03T23:01:07.673@Keith the inconsistency is for two reasons. First, I had other things, such as .emacs, at that location before cygwin. And second, my windows user name is assigned by admin, it is too long to type and different from all other computers I use. – user443854 – 2012-04-04T12:34:58.613