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: Wed, 17 May 2023 15:53:29 +0200 Message-ID: <87wn17ukrq.fsf@gmx.de> References: <877ct8w4bs.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="8057"; 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 Wed May 17 15:54:26 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 1pzHbl-0001qI-9z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 May 2023 15:54:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzHbQ-0005Nx-V4; Wed, 17 May 2023 09:54:04 -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 1pzHbO-0005Nf-Ns for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 09:54:02 -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 1pzHbO-00083v-G5 for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 09:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzHbO-0001Ty-5F for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 09:54: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: Wed, 17 May 2023 13:54: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.16843316195657 (code B ref 63539); Wed, 17 May 2023 13:54:02 +0000 Original-Received: (at 63539) by debbugs.gnu.org; 17 May 2023 13:53:39 +0000 Original-Received: from localhost ([127.0.0.1]:49342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzHb1-0001TB-9k for submit@debbugs.gnu.org; Wed, 17 May 2023 09:53:39 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:59995) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzHaz-0001Sw-NP for 63539@debbugs.gnu.org; Wed, 17 May 2023 09:53:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1684331610; i=michael.albinus@gmx.de; bh=Zj2ObXTI4b5R/KkqHhJ/QAXPTzdLNEmTo9OGKHAu1gI=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=qBYVts9aqlAoy+Lu8878hI4Db035KB40R9ps4riPwaK6nlqUIIOZ2qyIBXGigJIvd TwEWXIBIQnQjjFKKz2U9WghhvFJ3XPC6WfFPu7N69lBPdAPHMYlyVT4+oO5MAxgKWl MTYCuEZ9lSkbYvWg4j8lLatPoNhdpKNJf1DsaLMcHxTtV+B6DNxMlnQIAimbH8N1j2 lyZGUwyg0S4ncUnm0BQfZnREyn+8CoufSpMl0vHfpZxSFiiqgHIDpUmT4rAzxusRa/ bMZksx+oAklMLAXrAjKj7HfFzLSHrgXvwtLGvqYbjF3C1LD0L6v9wUZXhb7tD3GiUo JXtvHxOuIOldQ== 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 1M3lc9-1q06wL0BaV-000tuV; Wed, 17 May 2023 15:53:30 +0200 In-Reply-To: (Spencer Baugh's message of "Tue, 16 May 2023 15:28:25 -0400") X-Provags-ID: V03:K1:Vvt8il/hfnBiwBAxdM44163hlpNCz5QD0bvjWHp3rgWAPjgL88X dVbRB4uNdVOgE1J2E+A3T6A4ITgd0AMCtiw95mtgUTsP4CCP/dTr+Ch1CzdCnN9HbPySzh6 2vqRSq/ISYwo147aeQezGkMu8gCHgLUDLR38DheMrEAPFZoZ8Io9rjxNpVpJ2GyMt23c0eg SwEJh6IUosTuKY8nBZ9dQ== UI-OutboundReport: notjunk:1;M01:P0:iiGWobosvmY=;JKESq2blETebcT8vZHd/Fs+t4B0 s+5jeAT+CMX1SoxZ/YUik9qCAu0NX2oPlV/HYypHG9X2LiU90i+eboW7FrpY/iVjeE5qjeubs xYth1zoZaHIavrsINuqj5b8yIIyprzVg6y57usNSPKQ7m28G6m+BHTLQ4kKOBP0mXw/AVdL+j koJoub1gSG84mwvgiAwErg5mEe202WyzfykJdqMXkMyOz7/XYMLOytjTfjJBYhvy6O6xrXGYZ +DgzH3+mzJ8rx3FXlOhvFX06G9apT9VI+igNjRHFjMan4WY7Y3b1f/4rG5h+HrobPzq16EUws 8vnR5aeReoXZ9UylV+4xBLuhYTyJ6ViLQZGjr4jgmPnhF5o5ElzeUI2AxZo7Kre6qOGWBMCF9 0uvStmtWWV4Ccj6c0apGWTRob27j3STSCWzcIyMzCT/1tBkPVRScbOO4dhEABebOn42QGb6io Q/t05VdcMvYn5fN9lGsoZB51Pyrj7n/RVgiTDpI0qE8VP6hPHdWhFgTrpmwfsK75Aq5QsjV9f FP+xnwyS1HURTOSdKaVWFuKmdzOmfv5bKb4/uvkEkRRCrPgYWAfD+C8FIcRnirNpodhiHb58h wd63vyInuDAADZLpi/vTxEbKYzASfNDweAgtRwxBQe7E8enjDSo4Bw2jOFCDE6vxEib0tqDST 6EKyXLI20I9gYpqK/YXF+LzQI4sw/vcOF3x3AnEOz0LnW5Ge6Nuk25jPmuxbxWqssfZjCYDQQ IVehY6TwmeEqO9z4Xk+3ShGLWj+w8qF4sFv4DglES6E3LXevA2ihWH0RBA937cZ1XovGaRQf 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:261851 Archived-At: Spencer Baugh writes: Hi Spencer, >>> One can work around this by configuring the machine's prompt, but [] >>> seem relatively common in prompts (in my personal experience), and it >>> would be nice if this worked by default. (So far I've only seen [] in >>> custom prompts but there are probably some OSs/distributions with [] in >>> their prompt by default) >> >> What's wrong with the recipe for your remote .profile: >> >> [[ $TERM == "dumb" ]] && PS1='$ ' && return >> >> The Tramp manual gives an extended version of the recipe, which handles >> also the zsh line editing problem, but you see the idea. > > [] seem relatively common in prompts (in my personal experience), and it > would be nice if this worked by default. "[whatever]" is covered in Tramp. What isn't covered is your use case "[user@hostname] foo/bar/path $". > Just as an additional point, I'm not always connecting to hosts that I > can trivially change the .profile for. That's why you can customize shell-prompt-pattern or tramp-shell-prompt-pattern. >> And there is also the user option `tramp-shell-prompt-pattern' which you >> can customize as you like. > > Yes, I'm setting this to remove the ] as a possible prompt character as > a workaround. It isn't a workaround. It is the (documented way. >> Note, that Tramp cannot handle any case a user would prefer for >> detecting the prompt. > > If it can cheaply handle more cases, why not? Because there are further subtle problems. It isn't only about detecting the prompt. It is also about avoiding false positives. Think about text which is printed my motd. Or think about shell script fragments, which could appear here and there prior the prompt, like --8<---------------cut here---------------start------------->8--- if [ -n "$FOO" ]; then ... --8<---------------cut here---------------end--------------->8--- Tramp shouldn't trap into this, and there were reports in the past about. That's why I dislike to change the current state of affairs. Best regards, Michael.