iterm2 shell integration on host breaks Emacs tramp mode; need way to identify iterm2 clients
I installed iterm2 shell integration (i.e. ran curl -L https://iterm2.com/misc/install_shell_integration_and_utilities.sh | bash) on a Linux host I like to ssh into from my OSX laptop. Call the remote host "desktop". (I use zsh there if it matters.)
Emacs has a library called "tramp" that uses SSH to remotely look at a filesystem. In emacs I navigate to path "/ssh:desktop:path/to/file"; this opens a Emacs-based terminal that runs "ssh desktop" and finds the appropriate files.
After enabling the iterm2 shell integration, this breaks; emacs spins "waiting for prompt". I believe this is because Emacs's builtin terminal is confused by the escape characters used by iterm2.
I would like to modify my .zshrc on "desktop" so that it only modifies PS1/etc if the terminal I am ssh'ing from is an iterm2 instance. I am not clear how to do this; is it possible?
If not, do you see any other way to unbreak emacs and get the nice terminal integration?
Required information for bugs. I probably can't help you unless you include this:
- iTerm2 version
Build 3.0.14
- OS version
10.12.4
- Attach ~/Library/Preferences/com.googlecode.iterm2.plist here
- Attach a debug log (https://iterm2.com/debuglog)
I don't feel comfortable attaching either of these at the moment (too easy to have my employer's data be there) and I don't think they'll matter for this issue; let me know if you really need thme.