[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tramp + eshell
From: |
H. Dieter Wilhelm |
Subject: |
Re: Tramp + eshell |
Date: |
Fri, 29 Oct 2021 22:24:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) |
Michael Albinus <michael.albinus@gmx.de> writes:
> Daniel Kraus <daniel@kraus.my> writes:
>
>> Then you can "lcd /" and you would end up in "/plinkx:Eval:/".
Thank you Daniel for this idea, I now understand the concept of eshell
better.
> Or
>
> (defun eshell/lcd (&optional directory)
> "Like regular 'cd' but don't jump out of a tramp directory.
> When on a remote directory with tramp don't jump 'out' of the server.
> So if we're connected with sudo to 'remotehost'
> '$ lcd /etc' would go to '/sudo:remotehost:/etc' instead of just
> '/etc' on localhost."
> (setq directory (or directory "~/"))
> (unless (file-remote-p directory)
> (setq directory (concat (file-remote-p default-directory) directory)))
> (eshell/cd directory))
Thank you Michael for your version.
It's working nicely for me. :-)
Dieter
--
Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany