[Top][All Lists]

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

Re: tramp with shell mode and absolute paths

From: Michael Albinus
Subject: Re: tramp with shell mode and absolute paths
Date: Tue, 09 Feb 2010 05:45:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux)

Matthew Curry <address@hidden> writes:

> I guess I'm confused, if you *start* a shell on a remote host via
> tramp (and I'm not talking about ssh'ing in from a shell buffer you've
> already started directly, that's totally different and that's obvious
> why it wouldn't work), how is it *ever* useful to refer to files on
> the local host?  [e]shell-mode should *always* use the remote host's
> filesystem for all [e]shell-mode tasks.

Eshell does not open a shell on the remote host. It is able to run
processes wherever - that's a difference. The processes are performed on
the host, default-directory is pointing to.

You could do the following:

~ $ cp /sudo::/etc/shadow /tmp/123
~ $ diff /sudo::/etc/passwd /ssh:address@hidden:/etc/passwd

Your are still on the local host; if you call a program, it will be
applied here. If you do a "cd" to a remote directory, the next programs
will be applied there. And after that, you could even apply the next
"cd" etc. See this example

~ $ hostname
~ $ cd /ssh:anotherhost:
/ssh:address@hidden:/home/user $ hostname
/ssh:address@hidden:/home/user $

> Now maybe there is a reason why it acts like it does, but I'm not sure
> why yet.  Do you know how [e]shell-mode keeps track of the current
> directory of the shell it runs?

Like any other Emacs function: it uses default-directory. "cd" changes
its value.

> -Matt

Best regards, Michael.

reply via email to

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