[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Set PS1 on login?
From: |
Michael Albinus |
Subject: |
Re: Set PS1 on login? |
Date: |
Mon, 11 Jun 2018 18:29:38 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
John Collins <address@hidden> writes:
> Hello,
Hi John,
> Happy (mostly) tramp user here that is also very new to it. As someone
> working with remote machines that I do not own or control, TRAMPs
> inability to handle fancy prompts is highly crippling. It's stated in
> the FAQ that "tramp needs a clean recognizable prompt on the remote
> host for accurate parsing". What I don't understand is why tramp can't
> set PS1 when logging in the typical way one does:
>
> ssh ... -t 'PS1='$'; bash -i'
>
> When I modify tramp-maybe-open-connection to do this it works just
> fine; I'm able to login to a remote that would hang with the message:
>
> Tramp: Waiting for prompts from remote shell...fail
>
> I figure there is a good reason this can't be done, but wanted to
> raise the issue just in case.
ssh does not allow this kind of environment passing. Try in your local
shell
--8<---------------cut here---------------start------------->8---
# ssh localhost "PS1='$ '; /bin/sh"
--8<---------------cut here---------------end--------------->8---
or
--8<---------------cut here---------------start------------->8---
# ssh localhost "/usr/bin/env PS1='$ ' /bin/sh"
--8<---------------cut here---------------end--------------->8---
It doesn't work. Therefore, Tramp cannot use this mechanism.
Instead, Tramp recommends to adapt the remote prompt by something like
this in the remote ~/.profile:
--8<---------------cut here---------------start------------->8---
[ $TERM = "dumb" ] PS1='$ '
--8<---------------cut here---------------end--------------->8---
> Regards,
>
> John C.
Best regards, Michael.
- Set PS1 on login?, John Collins, 2018/06/11
- Re: Set PS1 on login?,
Michael Albinus <=