0

My cygwin terminals have been screwing up tilde(~) vs $HOME when I restart them after (yet another) Windows 10 reboot.

It seems to replace characters in the home directory with some unicode crap.

When I refer to $HOME, however, it seems to always reports the directory correctly. (However, since the directory seems to be changing all the time at the beginning, I may have just been lucky with $HOME.)

Here is an example session of trying to get the thing to work properly:

grandma@LAPTOP-XXXX ~
$ ls ~ | less

grandma@LAPTOP-XXXX ~
$ echo ~
/home/grand▒

grandma@LAPTOP-XXXX ~
$ echo $HOME
/home/grandma

grandma@LAPTOP-XXXX ~
$ ls ~ | less
ls: cannot access '/home/grand0': No such file or directory

grandma@LAPTOP-XXXX ~
$ set | less

$ echo ~
/home/grandma

...and one other...

$ echo ~
/home/grandma

grandma@LAPTOP-XXXX ~
$ ls ~ | less
ls: cannot access '/home/grand'$'\340': No such file or directory

grandma@LAPTOP-XXXX ~
$ echo ~
/home/grand▒

grandma@LAPTOP-XXXX ~
$ ls ~ | less
ls: cannot access '/home/grand'$'\200': No such file or directory

grandma@LAPTOP-XXXX ~
$ echo ~
/home/grandma

grandma@LAPTOP-XXXX ~
$ echo ~
/home/grandma

grandma@LAPTOP-XXXX ~

It seems to stabilize after a while, but I'd like to eliminate the problem. Can anyone tell what I'm looking for?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.