From: Michael Albinus <michael.albinus@gmx.de>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 31924@debbugs.gnu.org
Subject: bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh
Date: Sun, 24 Jun 2018 12:33:11 +0200 [thread overview]
Message-ID: <87a7rkv5i0.fsf@gmx.de> (raw)
In-Reply-To: <87wouopsqw.fsf@calancha-pc.dy.bbexcite.jp> (Tino Calancha's message of "Sun, 24 Jun 2018 16:07:35 +0900")
Tino Calancha <tino.calancha@gmail.com> writes:
> Hi Michael,
Hi Tino,
> I got a patch that works in my box. It does 2 things:
>
> 1) Ensure that zsh is invoked as zsh, that is, not as sh. Otherwise
> our dotfiles are ignored, and we keep getting the bracketed paste
> codes.
>
> 2) I also need to disable the zsh option promptcr, otherwise after I
> introduce my root password, Emacs gets stuck in `tramp-wait-for-output';
> this is becuse some '\r' are added in front the prompt, so the
> regexp in ``tramp-wait-for-regexp' cannot match.
Point 2) is OK. But your solution for point 1) doesn't work in general.
> @@ -4110,7 +4112,11 @@ tramp-open-connection-setup-interactive-shell
> process to set up. VEC specifies the connection."
> (let ((tramp-end-of-output tramp-initial-end-of-output)
> (case-fold-search t))
> - (tramp-open-shell vec (tramp-get-method-parameter vec 'tramp-remote-shell))
> + (tramp-open-shell
> + vec
> + (if (not (equal "sudo" (tramp-file-name-method vec)))
> + (tramp-get-method-parameter vec 'tramp-remote-shell)
> + (file-truename (tramp-get-method-parameter vec 'tramp-remote-shell))))
In tramp-sh.el, there shall be no code which relies on a given
method. Everything which is method specific, must be configured in
`tramp-methods'.
Furthermore, this code does not work at all. (file-truename "/bin/sh")
is always eval'ed on the local host, but you want to get information
about the remote host.
The better solution is to overwrite the `tramp-remote-shell' connection
property. Do something like this:
(add-to-list 'tramp-connection-properties
(list (regexp-quote "/ssh:user@randomhost.your.domain:")
"remote-shell" "/bin/zsh"))
See the Tramp manual, (info "(tramp) Predefined connection information")
Best regards, Michael.
next prev parent reply other threads:[~2018-06-24 10:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-21 9:09 bug#31924: 27.0.50; tramp handler /sudo::FILE fails when /bin/sh points to zsh Tino Calancha
2018-06-21 11:05 ` Michael Albinus
2018-06-24 7:07 ` Tino Calancha
2018-06-24 7:15 ` Tino Calancha
2018-06-24 10:33 ` Michael Albinus [this message]
2018-06-25 1:36 ` Tino Calancha
2018-06-25 12:54 ` Michael Albinus
2019-10-09 11:00 ` Michael Albinus
2019-10-16 10:41 ` Tino Calancha
2019-10-16 11:01 ` Michael Albinus
2019-10-16 11:36 ` Tino Calancha
2019-10-16 13:21 ` Michael Albinus
2019-10-17 15:24 ` Tino Calancha
2019-10-17 16:24 ` Michael Albinus
2018-06-25 15:22 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a7rkv5i0.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=31924@debbugs.gnu.org \
--cc=tino.calancha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).