From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: William Xu Newsgroups: gmane.emacs.bugs Subject: bug#54270: 29.0.50; tramp doesn't work for zsh with trailing zle_bracketed_paste "2004h" Date: Sun, 06 Mar 2022 11:08:18 +0100 Organization: the Church of Emacs Message-ID: <87bkyjcs19.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22521"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: 54270@debbugs.gnu.org Cancel-Lock: sha1:V01ZU6NhtRCLUHa/Rmeshz8FzLI= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 06 11:09:21 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nQnpJ-0005gA-5T for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Mar 2022 11:09:21 +0100 Original-Received: from localhost ([::1]:58664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQnpH-0008BM-KA for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Mar 2022 05:09:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQnp1-0008Aw-BH for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2022 05:09:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQnp0-0004jR-3k for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2022 05:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nQnoz-00005p-Sy for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2022 05:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: William Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Mar 2022 10:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54270 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1646561324323 (code B ref -1); Sun, 06 Mar 2022 10:09:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Mar 2022 10:08:44 +0000 Original-Received: from localhost ([127.0.0.1]:49867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQnoi-000059-Aq for submit@debbugs.gnu.org; Sun, 06 Mar 2022 05:08:44 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:49128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQnog-00004z-Lf for submit@debbugs.gnu.org; Sun, 06 Mar 2022 05:08:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQnog-0008AX-FR for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2022 05:08:42 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:57530) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQnoe-0004iA-Oy for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2022 05:08:42 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nQnoQ-0004ht-Nj for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2022 11:08:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228056 Archived-At: 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