Tramp should only change M-x shell startup when used in tramp buffers

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Tramp should only change M-x shell startup when used in tramp buffers

積丹尼 Dan Jacobson
I notice in emacs when tramp is running and we do M-x shell, we see the prompt

Remote shell path: /adb::/sdcard/GTs/gpx//system/bin/sh

That is great, but what if we just want an old fashioned local shell
like we see with plain emacs?

I propose if the user does M-x shell when the current directory of the
buffer he is in is just a local directory, then tramp should be
"hands off", and let him proceed the old fashioned way, with no such
scary prompts.

Currently for some reason when tramp starts it causes starting M-x shell
universally to behave different, no matter what buffer it is started
from.

tramp-version "2.4.2"

Reply | Threaded
Open this post in threaded view
|

Re: Tramp should only change M-x shell startup when used in tramp buffers

Michael Albinus
積丹尼 Dan Jacobson <[hidden email]> writes:

Hi Dan,

> I notice in emacs when tramp is running and we do M-x shell, we see the prompt
>
> Remote shell path: /adb::/sdcard/GTs/gpx//system/bin/sh
>
> That is great, but what if we just want an old fashioned local shell
> like we see with plain emacs?
>
> I propose if the user does M-x shell when the current directory of the
> buffer he is in is just a local directory, then tramp should be
> "hands off", and let him proceed the old fashioned way, with no such
> scary prompts.
>
> Currently for some reason when tramp starts it causes starting M-x shell
> universally to behave different, no matter what buffer it is started
> from.

I cannot confirm. Tramp is involved in the "M-x shell" business only if
the default-directory of the current buffer is remote.

Could you pls show a scenario where it behaves differently?

Best regards, Michael.

Reply | Threaded
Open this post in threaded view
|

Re: Tramp should only change M-x shell startup when used in tramp buffers

積丹尼 Dan Jacobson
Try this:
In a remote dired, do M-x shell, but then ^G when you see the long prompt.

OK, now in a local dired, do the same thing... and see the same results!

Apparently if the first time you attempted to start it was in a remote
buffer, that is then remembered for the rest of the emacs session.

Note above I have not actually got to the first "$" shell prompt,
canceling out with ^G each time I saw the scary long /.../.../.../ prompt.

Reply | Threaded
Open this post in threaded view
|

Re: Tramp should only change M-x shell startup when used in tramp buffers

Michael Albinus
積丹尼 Dan Jacobson <[hidden email]> writes:

Hi Dan,

> Try this:
> In a remote dired, do M-x shell, but then ^G when you see the long prompt.
>
> OK, now in a local dired, do the same thing... and see the same results!
>
> Apparently if the first time you attempted to start it was in a remote
> buffer, that is then remembered for the rest of the emacs session.
>
> Note above I have not actually got to the first "$" shell prompt,
> canceling out with ^G each time I saw the scary long /.../.../.../ prompt.

Once a shell buffer has been created, it is re-used. Even if you apply
^G, the buffer exists already.

If you want to use another buffer for your local shell, rename the
buffer *shell*.

This has nothing to do with Tramp, it doesn't know the shell
command. Maybe we need different shell buffers for different remote and
local hosts. Pls write an Emacs bug if you believe so.

Best regards, Michael.

Reply | Threaded
Open this post in threaded view
|

Re: Tramp should only change M-x shell startup when used in tramp buffers

積丹尼 Dan Jacobson
Well it is super clear to me now that the question prompt, (and chance
to ^G out of it) should be asked *before* the shell buffer is created
(and left hanging around, with exactly 0 characters in it too!)