Subject: bug#63633: Emacs becomes unresponsive when trying to ssh into localhost (MacOS)

From: Michael Albinus <[email-masked]>
Date: Mon, 22 May 2023 21:25:16 +0200

Arteen Abrishami <[email-masked]> writes:

Hi Arteen,

> The trace I sent was under ‘*debug tramp*’. There is also another under *debug tramp/ssh cs111@localhost#2222*’. I’m attaching both. The second is quite large. 

Thanks. I know it is large, but this is part of the analysis.

--8<---------------cut here---------------start------------->8---
> 11:21:04.120251 tramp-send-command (6) # exec ssh -l cs111 -p 2222 -o ControlMaster=auto -o ControlPath=tramp.%C -o ControlPersist=no -e none localhost
> 11:21:17.538440 tramp-search-regexp (1) # Quit: "Quit", ""
> Last login: Mon May 22 04:19:56 2023 from 10.0.2.2
> %                                                                               [01;32mcs111@cs111[00m [01;34m~[00m [00m [?2004h
--8<---------------cut here---------------end--------------->8---

Tramp has sent the "ssh -l ..." command. As result, it tries to detect
the shell prompt. It fails, because there are escape control sequences.

Pls teach your remote host NOT to send these characters. The Tramp
manual discusses the case.

If your remote shell is zsh, for example, you must add to the remote
~/.zshrc file

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

Best regards, Michael.