all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#54270: 29.0.50; tramp doesn't work for zsh with trailing zle_bracketed_paste "2004h"
@ 2022-03-06 10:08 William Xu
  2022-03-06 13:00 ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: William Xu @ 2022-03-06 10:08 UTC (permalink / raw
  To: 54270

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






^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-06 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-06 10:08 bug#54270: 29.0.50; tramp doesn't work for zsh with trailing zle_bracketed_paste "2004h" William Xu
2022-03-06 13:00 ` Michael Albinus
2022-03-06 18:41   ` William Xu
2022-03-06 19:11     ` Michael Albinus
2022-03-06 20:13       ` William Xu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.