Yes, this is intended. "cd" is a built-in command of eshell, and it interprets the directory name like a Lisp file name. "~" is your local home directory. If you do "C-x C-f ~", you will always open your local home directory, whereever you call it from in Emacs.
I was just wondering because calling cp /some/file ~, copies the file to the remote home directory, therefore the tilde is interpreted differently in this case.
Since Emacs 29, there is the extension module eshell-elecslash. Add the following lines to your .emacs: --8<---------------cut here---------------start------------->8--- (require eshell (add-to-list 'eshell-modules-list 'eshell-elecslash) --8<---------------cut here---------------end--------------->8--- Now, when you are in eshell on a remote directory, and you type a command argument beginning with "/" or "~/", this will be replaced by the remote file identification. That is, in your example you type "cd ~/" and that's it. Read the Eshell manual.
Thanks a lot for the pointer, will try it out and see if this helps. As always I really appreciate your quick replies! Best regards, -- Reza Housseini This message is signed with my GnuPG key: C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52
OpenPGP_0xC375C6AF05125C52.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature