tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eshell and eshell-directory-change-hook


From: Alexey Lebedeff
Subject: Re: eshell and eshell-directory-change-hook
Date: Wed, 16 Nov 2016 12:04:51 +0300
User-agent: mu4e 0.9.16; emacs 25.1.1

Hi Michael,

Michael Albinus writes:

>> Running remote commands through eshell starts to work only after doing
>> "cd" at least once. This is because some tramp setup happens in
>> eshell-directory-change-hook.
>>
>> I'm not sure whether it should be fixed in tramp, by "(add-hook
>> 'eshell-mode-hook 'tramp-eshell-directory-change)". Or in eshell, by
>> teaching it to invoke eshell-directory-change-hook during
>> initialization. And it's arguable whether eshell initialization can be
>> considered as a directory change or not =)
>
> I cannot reproduce it locally. Using a recent GNU Emacs 26.0.50.1, I run:
>
> --8<---------------cut here---------------start------------->8---
> # emacs -Q /sudo::
>
> M-x eshell
> /sudo:address@hidden:/root $ *pwd
> /root
> --8<---------------cut here---------------end--------------->8---
>
> Could you, pls, show your use case? Starting with "emacs -Q" shall
> avoid user specific side effects.

This happens when local and remote PATHs are completely incompatible. In
my case emacs runs on NixOS and remote host is Debian. On NixOS PATH
(and thus eshell-path-env) doesn't contain any standard directories like
'/bin' or '/usr/bin'. So right after eshell to remote host is opened,
this incompatible eshell-path-env is inherited - and command execution
is broken until I do some "cd" (at which point
"tramp-eshell-directory-change" does its magic).

So for me it looks like this:

--8<---------------cut here---------------start------------->8---
address@hidden emacs -Q /ssh:debian-host:

M-x eshell
/ssh:debian-host:/home/binarin $ *pwd
pwd: external command not found
/ssh:debian-host:/home/binarin $ cd .
/ssh:debian-host:/home/binarin $ *pwd
/home/binarin
--8<---------------cut here---------------end--------------->8---

Best,
Alexey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]