Subject: Re: bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh

From: Michael Albinus <[email-masked]>
Date: Wed, 16 Oct 2019 15:21:17 +0200

Tino Calancha <[email-masked]> writes:

Hi Tino,

>> Then open a remote file (it's sudo'ed, isn't it?), and after the error,
>> pls send me the complete Tramp debug buffer.
>
> Sent offlist to Michael the content of the tramp debug buffers.

Thanks, this made it obvious what happened. I could reproduce it locally.

When I've fixed this bug, I've tested with the ssh method. sudo is kinda
different, I have adapted now the template for calling it.

Works for me now also with sudo. Pushed to master. Could you pls check?

When you recompile the pulled sources, you need also to regenerate
tramp-loaddefs.el. This is not performed by default, so I suggest to
apply at least

--8<---------------cut here---------------start------------->8---
make -C lisp autoloads all
--8<---------------cut here---------------end--------------->8---

Note also, that you need both these settings

--8<---------------cut here---------------start------------->8---
(setq tramp-encoding-shell "/usr/bin/zsh")
(add-to-list
 'tramp-connection-properties '("^/sudo:" "remote-shell" "/usr/bin/zsh"))
--8<---------------cut here---------------end--------------->8---

Of course, you could apply any regexp instead of "^/sudo:". If you take
nil instead, "/usr/bin/zsh" would run on all your remote hosts.

Best regards, Michael.