From: Michael Albinus <michael.albinus@gmx.de>
To: Spencer Baugh <sbaugh@janestreet.com>
Cc: 63539@debbugs.gnu.org
Subject: bug#63539: 29.0.90; TRAMP fails to detect shell prompts containing ]
Date: Wed, 17 May 2023 18:56:05 +0200 [thread overview]
Message-ID: <87bkiivqvu.fsf@gmx.de> (raw)
In-Reply-To: <87h6sbufv3.fsf@gmx.de> (Michael Albinus's message of "Wed, 17 May 2023 17:39:28 +0200")
[-- Attachment #1: Type: text/plain, Size: 310 bytes --]
Michael Albinus <michael.albinus@gmx.de> writes:
Hi Spencer,
> That's why I've proposed the alternative, filtering out escape
> sequences. Using existing functions from specialized packages.
Hmm, perhaps the appended simplistic patch would do the job already?
Could you, pls, test?
Best regards, Michael.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1419 bytes --]
diff --git a/lisp/tramp.el b/lisp/tramp.el
index 910d5343..1fd5e0aa 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -624,9 +624,7 @@ Sometimes the prompt is reported to look like \"login as:\"."
;; connection initialization; Tramp redefines the prompt afterwards.
(rx (| bol "\r")
(* (not (any "\n#$%>]")))
- (? "#") (any "#$%>]") (* blank)
- ;; Escape characters.
- (* "^[[" (* (any ";" digit)) alpha (* blank)))
+ (? "#") (any "#$%>]") (* blank))
"Regexp to match prompts from remote shell.
Normally, Tramp expects you to configure `shell-prompt-pattern'
correctly, but sometimes it happens that you are connecting to a
@@ -5883,11 +5881,14 @@ Otherwise, return nil."
"Check, whether REGEXP is contained in process buffer of PROC.
Erase echoed commands if exists."
(with-current-buffer (process-buffer proc)
- (goto-char (point-min))
+ ;; Remove color escape sequences.
+ (when (tramp-search-regexp tramp-display-escape-sequence-regexp)
+ (replace-match ""))
;; Check whether we need to remove echo output. The max length of
;; the echo mark regexp is taken for search. We restrict the
;; search for the second echo mark to PIPE_BUF characters.
+ (goto-char (point-min))
(when (and (tramp-get-connection-property proc "check-remote-echo")
(re-search-forward
tramp-echoed-echo-mark-regexp
next prev parent reply other threads:[~2023-05-17 16:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 16:40 bug#63539: 29.0.90; TRAMP fails to detect shell prompts containing ] Spencer Baugh
2023-05-16 17:53 ` Michael Albinus
2023-05-16 19:28 ` Spencer Baugh
2023-05-16 20:06 ` Spencer Baugh
2023-05-17 14:07 ` Michael Albinus
2023-05-17 14:59 ` Spencer Baugh
2023-05-17 15:39 ` Michael Albinus
2023-05-17 16:56 ` Michael Albinus [this message]
2023-05-17 17:28 ` Michael Albinus
2023-05-17 18:08 ` Spencer Baugh
2023-05-17 18:41 ` Michael Albinus
2023-05-18 15:49 ` Michael Albinus
2023-05-20 10:18 ` Michael Albinus
2023-05-22 17:30 ` Spencer Baugh
2023-05-22 19:17 ` Michael Albinus
2023-05-22 19:45 ` Spencer Baugh
2023-05-23 13:49 ` Michael Albinus
2023-05-23 14:34 ` Spencer Baugh
2023-05-23 16:31 ` Michael Albinus
2023-05-25 7:36 ` Michael Albinus
2023-05-17 13:53 ` Michael Albinus
2023-05-17 14:04 ` Spencer Baugh
2023-05-17 14:12 ` Michael Albinus
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=87bkiivqvu.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=63539@debbugs.gnu.org \
--cc=sbaugh@janestreet.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).