Subject: Re: bug#78508: Tramp confused by bracketed paste after remote prompt

From: Michael Albinus <[email-masked]>
Date: Thu, 22 May 2025 13:25:47 +0200

Daniel Colascione <[email-masked]> writes:

Hi Daniel,

>>> When the remote shell emits bracketed paste escape codes (as zsh does
>>> even when TERM=dumb), tramp ends up timing out unable to find the shell
>>> prompt on initial connection.
>>
>>Have you checked the recipe from the Tramp manual in (info "(tramp)
>>Frequently Asked Questions") ?
>
> It shouldn't be necessary to do that. Sometimes modifying the target
> system isn't all that straightforward, and control sequences should be
> straightforward to strip. There's already an attempt to strip ANSI
> color, yes? It's not like Tramp is trying to avail itself of the
> opportunities SSH provides to make noninteractive use feasible.

Tramp won't go into the prompt parsing business. Filtering ANSI color
sequences out was a compromise a while ago. You let feel me that it was
an error to do so.

> Failure mode is just "when I try to use Emacs to connect to
> this family of hosts, it hangs. VSCode works. I guess I'll stick with
> that"

That's unfair, and you know it.

Have you tried the patch I've shown?

Best regards, Michael.