Subject: Re: bug#34192: 26.1; Bash 5.0 breaks TRAMP sudo

From: Allen Li <[email-masked]>
Date: Fri, 8 Feb 2019 08:45:25 +0000

On Thu, Feb 7, 2019 at 9:27 AM Michael Albinus <[email-masked]> wrote:
>
> Allen Li <[email-masked]> writes:
>
> Hi Allen,
>
> > I finally traced the problem down to setting tramp-histfile-override to t.
> >
> > Apparently, Bash 5.0 doesn't like HISTSIZE=0.  Changing it to
> > HISTSIZE=1 fixes the error.
>
> Is this new in bash 5.0? I have installed GNU bash 4.4.19, and its
> info manual says:
>
> --8<---------------cut here---------------start------------->8---
> 'HISTSIZE'
>      The maximum number of commands to remember on the history list.  If
>      the value is 0, commands are not saved in the history list.
>      Numeric values less than zero result in every command being saved
>      on the history list (there is no limit).  The shell sets the
>      default value to 500 after reading any startup files.
> --8<---------------cut here---------------end--------------->8---
>
> Hmm, there's exactly the same text in
> https://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz/bash-5.0/doc/bash.info
>
> Before changing Tramp, I'd like to understand what's up.

To be clear, I'm not suggesting any change in Emacs to fix this.  All
signs point to this being an obscure bug in Bash.  I may take this
upstream (but I don't think it's worth the effort as there's a very
simple workaround of using dash for /bin/sh).

>
> > Reproduce:
> >
> > 1. emacs -Q
> > 2. (setq tramp-histfile-override t)
> > 3. C-x C-f /sudo::/ TAB <enter sudo password> RET
>
> Do you have some special settings in your remote .profile,
> .bash_profile, .bash_login, or .bashrc?  Could you test with moving
> these files away?

I don't think so, as TRAMP starts /bin/sh without anything that should
load any of those files.  I may try at some point, but again since
there's a simple workaround I'm hitting the limit of how much effort I
want to put into this.

Perhaps more people will run into this bug once Bash 5 pushes out to
the larger distros, or the bug will get fixed inadvertently.  I don't
have any opinions on whether to keep this bug open or close in the
meantime.

Thanks for your help so far.

> Best regards, Michael.