Non-Cygwin Windows applications are not aware of your Cygwin root or home directory.
Emacs is a special case. It was originally developed on UNIX, and it uses UNIX-like syntax for some things.
According to your latest comment, Emacs expands ~
to C:\Users\Tudor
. That's your Windows home directory, not your Cygwin home directory.
You can also install a Cygwin version of Emacs, which, like any Cygwin application, will expand ~
to your Cygwin home directory.
If you invoke a Windows application from a Cygwin shell, then the shell, not the Windows application, will expand ~
to your Cygwin home directory, expressed in Cgywin syntax. For example, assuming runemacs
is a non-Cygwin application, if I run:
bash$ runemacs ~
then the shell expands the ~
, so it's equivalent to (assuming my user name is Tudor
):
bash$ runemacs /home/Tudor
runemacs
will probably treat /home/Tudor
as equivalent to \home\Tudor
, which would be equivalent to C:\home\Tudor
if the current drive is C:
.
If you type Ctrl-X Ctrl-F from within Emacs to open a file, then Emacs will interpret ~
according to whatever rules it follows internally; those rules aren't likely to recognize Cygwin unless you're running a Cygwin version of Emacs or Emacs itself has some special-case code to handle Cygwin paths.