GNU bug report logs -
#54270
29.0.50; tramp doesn't work for zsh with trailing zle_bracketed_paste "2004h"
Previous Next
Reported by: William Xu <william.xwl <at> gmail.com>
Date: Sun, 6 Mar 2022 10:09:01 UTC
Severity: normal
Tags: moreinfo, notabug
Found in version 29.0.50
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54270 in the body.
You can then email your comments to 54270 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54270
; Package
emacs
.
(Sun, 06 Mar 2022 10:09:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
William Xu <william.xwl <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 06 Mar 2022 10:09:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
When using tramp to ssh into a remote with zsh, it never finishes, but
trapped in below `while':
---------------------------------8<-------------------------------------
(defun tramp-process-one-action (proc vec actions)
"Wait for output from the shell and perform one action.
See `tramp-process-actions' for the format of ACTIONS."
(let ((case-fold-search t)
tramp-process-action-regexp
found todo item pattern action)
(while (not found)
---------------------------------8<-------------------------------------
After some debugging, it turns out that zsh is adding some special
zle_bracketed_paste at the end of the prompt: "~ % [?2004h", which
makes the regexp matching fail. I have to make below change to fix it.
Later I found various issues of zsh are actually already discussed on
emacswiki: https://www.emacswiki.org/emacs/TrampMode#toc8 Alternative
solution discussed there is to change .zshrc file.
However, considering zsh has become the default shell in some OSes, like
macOS, would it be possible to resolve this at tramp? Using changes like
below? Or make regexp "\\'" be part of user configurable option, like
tramp-shell-prompt-pattern?
---------------------------------8<-------------------------------------
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 932dfb3691..7225c9ed3a 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4932,7 +4932,7 @@ tramp-process-one-action
(while todo
(setq item (pop todo)
tramp-process-action-regexp (symbol-value (nth 0 item))
- pattern (format "\\(%s\\)\\'" tramp-process-action-regexp)
+ pattern (format "\\(%s\\)" tramp-process-action-regexp)
action (nth 1 item))
(tramp-message
vec 5 "Looking for regexp \"%s\" from remote shell" pattern)
---------------------------------8<-------------------------------------
In GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
of 2022-02-23 built on 8e6ade8fe188
Repository revision: 304c373c98ffdba8f946072f15fd109c4cef533f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Ubuntu 20.04.3 LTS
--
William
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54270
; Package
emacs
.
(Sun, 06 Mar 2022 13:01:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 54270 <at> debbugs.gnu.org (full text, mbox):
William Xu <william.xwl <at> gmail.com> writes:
Hi William,
> After some debugging, it turns out that zsh is adding some special
> zle_bracketed_paste at the end of the prompt: "~ % [?2004h", which
> makes the regexp matching fail. I have to make below change to fix it.
Indeed. The Tramp manual discusses the issue, and recommends to set on
the remote ~/.zshrc:
--8<---------------cut here---------------start------------->8---
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
--8<---------------cut here---------------end--------------->8---
> However, considering zsh has become the default shell in some OSes, like
> macOS, would it be possible to resolve this at tramp? Using changes like
> below? Or make regexp "\\'" be part of user configurable option, like
> tramp-shell-prompt-pattern?
I don't want to change this, due to possible damages for other
configurations. However, the Tramp manual recommends to tell Tramp, that
the remote shell is zsh, see (info "(tramp) Remote shell setup")
Tramp will behave correctly then.
Best regards, Michael.
Added tag(s) moreinfo.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 06 Mar 2022 16:22:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54270
; Package
emacs
.
(Sun, 06 Mar 2022 18:43:02 GMT)
Full text and
rfc822 format available.
Message #13 received at submit <at> debbugs.gnu.org (full text, mbox):
Michael Albinus <michael.albinus <at> gmx.de> writes:
> I don't want to change this, due to possible damages for other
> configurations.
OK. So with default setup, "ssh + zsh" simply won't work out of box..
> However, the Tramp manual recommends to tell Tramp, that
> the remote shell is zsh, see (info "(tramp) Remote shell setup")
> Tramp will behave correctly then.
Following the info, the issue can be indeed also fixed by using
sshx. (though I have to install sshx first)
Thanks.
--
William
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54270
; Package
emacs
.
(Sun, 06 Mar 2022 19:12:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 54270 <at> debbugs.gnu.org (full text, mbox):
William Xu <william.xwl <at> gmail.com> writes:
Hi William,
>> However, the Tramp manual recommends to tell Tramp, that
>> the remote shell is zsh, see (info "(tramp) Remote shell setup")
>> Tramp will behave correctly then.
>
> Following the info, the issue can be indeed also fixed by using
> sshx. (though I have to install sshx first)
You don't need to install "sshx". It is just the name of a Tramp method,
which still uses ssh internally.
> Thanks.
Best regards, Michael.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54270
; Package
emacs
.
(Sun, 06 Mar 2022 20:14:01 GMT)
Full text and
rfc822 format available.
Message #19 received at submit <at> debbugs.gnu.org (full text, mbox):
Michael Albinus <michael.albinus <at> gmx.de> writes:
> You don't need to install "sshx". It is just the name of a Tramp method,
> which still uses ssh internally.
Ah, you are right... :) Now I can remove the sshx command line installed
via python pip.
--
William
Added tag(s) notabug.
Request was from
Michael Albinus <michael.albinus <at> gmx.de>
to
control <at> debbugs.gnu.org
.
(Mon, 07 Mar 2022 08:07:01 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
54270 <at> debbugs.gnu.org and William Xu <william.xwl <at> gmail.com>
Request was from
Michael Albinus <michael.albinus <at> gmx.de>
to
control <at> debbugs.gnu.org
.
(Mon, 07 Mar 2022 08:07:01 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 04 Apr 2022 11:24:07 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 75 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.