bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#63539: 29.0.90; TRAMP fails to detect shell prompts containing ]


From: Michael Albinus
Subject: bug#63539: 29.0.90; TRAMP fails to detect shell prompts containing ]
Date: Tue, 16 May 2023 19:53:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Spencer Baugh <sbaugh@janestreet.com> 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:

--8<---------------cut here---------------start------------->8---
[[ $TERM == "dumb" ]] && PS1='$ ' && return
--8<---------------cut here---------------end--------------->8---

The Tramp manual gives an extended version of the recipe, which handles
also the zsh line editing problem, but you see the idea.

And there is also the user option `tramp-shell-prompt-pattern' which you
can customize as you like.

Note, that Tramp cannot handle any case a user would prefer for
detecting the prompt.

Best regards, Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]