Michael Albinus writes: > 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 $". Again I want to note that "[user@hostname] $" is the default on RHEL/Fedora machines, which surely are common enough that TRAMP to them needs to be supported out of the box in Emacs. And indeed they work today in Emacs, they only break when the prompt is colored. How about this patch, which is a separate enhancement to shell-prompt-pattern to allow it to match colored prompts? Which is a useful feature for shell-mode, and as a side-effect fixes this bug.