[Top][All Lists]

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

Re: prompt has changed with an update

From: Thomas Walker Lynch
Subject: Re: prompt has changed with an update
Date: Thu, 8 Oct 2020 08:53:00 +0200

Hello,  so I understand the issue better, and read through the quite reasonable doc.  This is mostly an FYI reply to share what I learned, although any tips would be appreciated of course.

The issue is that the shell has changed, though I am not sure why.  Thus my .bashrc file does not run, and thus the prompt is not set.  

When I ssh to a machine, it runs the shell found in /etc/passwd.   When I run a remote shell from Tramp, though it makes use of ssh (it seems),  it runs /bin/sh.   I am not sure if a linux update on the server changed /bin/sh from bash to dash, but I would not be surprised.  Discussion on that has been going on for years.  It seems more likely that something has changed in the way ssh is being invoked.

So, I gather that Tramp wants to pick the shell, and it will not come from /etc/passwd.   Is there a way to configure that?   There was some mention of a /etc/passwd reader function in the docs.  This would be the best solution.   A solution that would work for me is to always use /usr/bin/bash.

I found various things in the doc for coercing Tramp to pick a different shell:

;(add-to-list 'tramp-connection-properties
;             (list (regexp-quote "/")
;               "remote-shell" "/usr/bin/bash"))
;(customize-set-variable 'tramp-encoding-shell "/usr/bin/bash")

  '((explicit-shell-file-name . "/bin/bash")
    (explicit-bash-args . ("-i"))))

  '(:application tramp :protocol "ssh" :machine "localhost")

  '(:application tramp :protocol "ssh" :machine "")

The commented out lines did nothing. Perhaps if I play around with it more.  Actually given that is a regular _expression_, perhaps I should just match '.*',  as I always use bash  anyway.   The other lines convinced Tramp to call /usr/bin/bash on the one account, but the sudo root stuff is still runing /bin/sh.  I will play around with that more also.  Again, the shell specified in /etc/passwd would be best, but /usr/bin/bash would work for me.

Hmm,  I wonder if my .bashrc to .shrc would also get my prompt set...

Now that I understand what is happening, I have found a reasonable work around.   I just run bash at the first prompt, the .bashrc runs and the prompt is set, then life is good.

Thanks again.  Tramp is a wonderful tool.   If the dired stuff works remotely.  It is a blessing for emacs users.

On Thu, Sep 24, 2020 at 4:33 PM Michael Albinus <> wrote:
Thomas Walker Lynch <> writes:

Hi Thomas,

> Thanks Michael.  Looks like I should have gone to the Tramp manual,

Don't worry. My experience is, that *nobody* reads the manual.
Sometimes, I have the impression I write it just for myself, in case I
have forgotten something ...

> but I was confused.  It truly was working before.  It is tied into my
> dirtrack  and elsewhere so there is no way I could have confused that.
>  I also modify the prompt when entering projects by adding the project
> name.  I developed a lot of code using remote access through Tramp.  I
> also set an inside emacs environment variable in scripts.  RTFM time .
> .. why every time I ask a question ...

If anything is not clear, just ask. And if it isn't clear in the manual,
tell it. I'm not a native English speaker ...

Best regards, Michael.

reply via email to

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