From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#63539: 29.0.90; TRAMP fails to detect shell prompts containing ] Date: Tue, 16 May 2023 15:28:25 -0400 Message-ID: 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="22381"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63539@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 16 21:29:22 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 1pz0MM-0005e2-7h for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 May 2023 21:29:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pz0M4-00039h-GV; Tue, 16 May 2023 15:29: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 1pz0M2-00039Q-Us for bug-gnu-emacs@gnu.org; Tue, 16 May 2023 15:29: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 1pz0M2-0007vX-GC for bug-gnu-emacs@gnu.org; Tue, 16 May 2023 15:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pz0M2-0005sB-5f for bug-gnu-emacs@gnu.org; Tue, 16 May 2023 15:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 May 2023 19:29: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.168426531422536 (code B ref 63539); Tue, 16 May 2023 19:29:02 +0000 Original-Received: (at 63539) by debbugs.gnu.org; 16 May 2023 19:28:34 +0000 Original-Received: from localhost ([127.0.0.1]:48098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pz0La-0005rP-99 for submit@debbugs.gnu.org; Tue, 16 May 2023 15:28:34 -0400 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:50999) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pz0LY-0005r7-G4 for 63539@debbugs.gnu.org; Tue, 16 May 2023 15:28:33 -0400 In-Reply-To: <877ct8w4bs.fsf@gmx.de> (Michael Albinus's message of "Tue, 16 May 2023 19:53:27 +0200") 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:261808 Archived-At: Michael Albinus writes: > Spencer Baugh writes: > > Hi Spencer, > >> Attempting to ssh to a machine with a prompt like: >> >> [user@hostname] foo/bar/path $ >> >> will hang, because TRAMP thinks that the prompt ends at the "]", not the >> "$". >> >> I guess this is because TRAMP supports prompts like "[foo bar baz]" with >> no trailing $. And it isn't greedy when reading the prompt, so it stops >> at the first "]". >> >> 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. Just as an additional point, I'm not always connecting to hosts that I can trivially change the .profile for. > 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. > Note, that Tramp cannot handle any case a user would prefer for > detecting the prompt. If it can cheaply handle more cases, why not?