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: Tue, 23 May 2023 15:49:07 +0200 [thread overview]
Message-ID: <87zg5vw430.fsf@gmx.de> (raw)
In-Reply-To: <ierlehg6tg7.fsf@janestreet.com> (Spencer Baugh's message of "Mon, 22 May 2023 15:45:44 -0400")
Spencer Baugh <sbaugh@janestreet.com> writes:
Hi Spencer,
>>> I'm guessing the reason is because this version of the regexp doesn't
>>> support multiple escape codes, or blanks in between/at the end of the
>>> escape codes?
>>
>> Blanks as parts of escape codes are unlikely.
>
> In the middle, perhaps, but after the escape codes seems quite likely to
> me. At the very least, my prompt (which worked on Emacs 29 and no
> longer works with your change) has blanks after the escape codes.
>
> For reference, my now-broken prompt is:
> PS1='\[\033[01;32m\]\u@\[\e[${hostnamecolor}m\]\h\[\033[01;34m\] \w \$\[\033[00m\] '
Thanks. But nobody forbids that you use "_" (underscore) instead of
blanks in your prompt, for example. Not very likely, I know. But I want
a solution now and forever.
>> Multiple escape codes are not regarded indeed, my patch did expect that
>> there is not more as one escape code at the end of the shell prompt.
>>
>> Your example is an indication of escape codes, mixed inside the shell
>> prompt. My first attempt (removing all escape codes from the buffer
>> region) did handle that. But as said, there were other regressions with
>> that attemot.
>
> What's wrong with my diff, though? It produces behavior which is much
> closer to how TRAMP behaved before your change, while still fixing my
> issue.
I've pushed another change to master which goes back to my first
approach: Remove escape sequences in the buffer, before you look for the
prompt.
The difference is now, that this happens *only* in the initial
connection phase with a remote host, and not later. After that phase we
have a PS1 setting applied by Tramp, which is escape sequences free.
This approach should avoid the problems I've seen when I've applied a
similar change some days ago. I still need to run all regression test
cases, but a check for crucial tests tell me that we could be optimistic
now :-)
Could you pls check this change?
>> Hmm. Could you please send me a tramp-verbose 10 trace of your failing test?
>
> I'm not sure how useful this is, but:
I meant the Tramp debug buffer, producesd by setting tramp-verbose to
10. But since you have shown me your PS1 setting above, this isn't
needed anymore, thanks.
Best regards, Michael.
next prev parent reply other threads:[~2023-05-23 13:49 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
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 [this message]
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=87zg5vw430.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).