From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#63539: 29.0.90; TRAMP fails to detect shell prompts containing ] Date: Tue, 23 May 2023 15:49:07 +0200 Message-ID: <87zg5vw430.fsf@gmx.de> References: <877ct8w4bs.fsf@gmx.de> <87sfbvuk4r.fsf@gmx.de> <87h6sbufv3.fsf@gmx.de> <87bkiivqvu.fsf@gmx.de> <877ct6vpdd.fsf@gmx.de> <871qjevlzc.fsf@gmx.de> <87r0rdtzax.fsf@gmx.de> <877ct3tife.fsf@gmx.de> <87mt1wdvlk.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11630"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63539@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 23 15:53:13 2023 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 1q1SRt-0002nJ-3A for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 May 2023 15:53:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1SOr-00084I-QA; Tue, 23 May 2023 09:50:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1SOq-0007zE-7d for bug-gnu-emacs@gnu.org; Tue, 23 May 2023 09:50:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1SOo-0001kL-DL for bug-gnu-emacs@gnu.org; Tue, 23 May 2023 09:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q1SOo-0001hI-6X for bug-gnu-emacs@gnu.org; Tue, 23 May 2023 09:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 May 2023 13:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63539 X-GNU-PR-Package: emacs Original-Received: via spool by 63539-submit@debbugs.gnu.org id=B63539.16848497596467 (code B ref 63539); Tue, 23 May 2023 13:50:02 +0000 Original-Received: (at 63539) by debbugs.gnu.org; 23 May 2023 13:49:19 +0000 Original-Received: from localhost ([127.0.0.1]:38710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1SO6-0001gF-JS for submit@debbugs.gnu.org; Tue, 23 May 2023 09:49:18 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:49889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1SO4-0001g0-61 for 63539@debbugs.gnu.org; Tue, 23 May 2023 09:49:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1684849748; i=michael.albinus@gmx.de; bh=3cm8l71sJlSL0tw1E4ZhifsS+oom1rhRAaDNLlirDc0=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=EGfljmkLoWyVxkOogtXNfrXnWQwGneOkAxqVthc7UBoFdpSfm0VxM4eb+FSBgLunn FybUMSXDBX+ycbnona1RVFgyutAwH7mixXGrskD282vrpDF5mjoVbMixtS17b/B5el z3uvF+WJV4sQEcOccLhXNoeXjNC6MXjkrfamJAaf8rs6E2e5EUkNPGd7st0CSuptiD zIhScn3xhX6avnIeDohMC4ZWajWeG4lwPE+AEPliBtz98JkyM6HBBdJrskFQcWG4Z7 OZ1xYiw6TCeZEbX5vrYt61eCKTbp91RMy3cYWusFUwzSA8sYD7mM6ump9blR9ObbW8 nP9/vG3Ar9Fbg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.13]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MpUUw-1qSsFk2Xka-00pyCr; Tue, 23 May 2023 15:49:08 +0200 In-Reply-To: (Spencer Baugh's message of "Mon, 22 May 2023 15:45:44 -0400") X-Provags-ID: V03:K1:zRpNjooMnZy94YZCEtmgu5MJGwH48u7l1/BIxHLjYch6MbzHIQV pnfIebzZ1GkHTtUYs5+xeHM2uE2Soq17TRODFQiSVHxTUwdcZf3q0SqGh/xxgaPdCATOKDp ujsZUCXb//86zLgTw0lgx0NV+lr6HS4JPpAKIRS5oVAD6uc04An5JvaO+roiMW995TndXIc BAsM1u+aNJno5GhEC2+nw== UI-OutboundReport: notjunk:1;M01:P0:vmM6+XIAguw=;CVcbUVx4RQBA7qwTH7CKzR6Ltcn u6QPbqX/Pebxz81J9cipbC8MtRefuIOpjMWzHWmNq89mjKbFZ4euu8AzImo3n4gVKbQGtx3pD iwb/K0fUlqMZy0LGTN0W1G2EZxjWoYkaiyu058WbEvnp6LgXCxH6tmt8kEzxg/0zDRuKZgGVh z5xpSMOLfqZswSJ8PliUiwMTprWlJtqv2r49GEEKzrG71E/w/sf/f0wpINngZwx0CbXRqQCRg Pz6UuaOeifb8FKlr2ep8nHTRsPtOu7gtZY0QE5KtJ1IrqaChlAS2I1lxpLv69UFBVL7qa6RB8 08Bu4I+v9pNtALiNC0/7M6TyMWBJKHz7fx7/M0qkYY/JUJg6LYuCX2WIQxG5p7YHcp31OnhJF +zwv79ouqPOMfGVmdrxkjwm6zk883IBgWTk9xKC1qWXFW17tkePltO9015ixdjEZSr9bPII8i EXFrbH19ODosqS27oCwTD8YniDuyJdJixLeVnNItdUZBuQkp8OC4IyEPah7pd6ihExTTP006a Tce/h2sRXr6Mts8Rza+MGe2Sj8pccSZIlVLzXpm/ikaKQqqg7w4IWm+Vgjc0Fz3A/csSUxE5E haoNa+xjmDSei0ioMPjcIs0uWqDtpfpYidtfv3f/uvYRy3p6NxbFFtIVLAGzegAQYpJJbyjjz 9lzjltfoFZJGVt5Yo4YcxcFWtx0oz93vI1DyVXmUJ6bFU64lFYgE70OoIwhprCr8gbnb+iaqC Iiy3NpMmwXEY3fD4565e3SbLKB3LZAp3BYZ7c+KUoRklJCFzSPZNv1e/KD5vvUrSrripPsAf 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262233 Archived-At: Spencer Baugh 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.