I use oh-my-zsh and iterm2 (on my Macs). The issue is when I ssh from a Mac to another host on which I have an account (usually linux). There I also have oh-my-zsh installed. I have the iterm2 plugin enabled and turned on the iterm2 shell integration according to the iterm2 plugin documentation.
When I run an ssh command to another host, I see the iterm2 tab title change as I would expect (with the name of the remote host) during the ssh connection process, and then once oh-my-zsh is run on the remote host, the prompt is reset to what it was before the ssh connection. I've tried turning off the shell integration / iterm2 plugin on the remote host, to no avail.
How is this supposed to work? All tips appreciated.
edit:
When I ssh into a host for which oh-my-zsh is not installed (for example I ssh into a root account and get bash) then the title works as I expect, so it appears to be some interference between oh-my-zsh settings remote vs local.
I figured it out - maybe this helps someone else.
iterm2oh-my-zshplugin on the remote host is irrelevant - that only does something if the remote host is a Mac.iterm2plugin and also use theomzdirective to turn on the shell integration as described in the plugin documentation..zshrc.iterm2preferences and look at Profiles-General where under Basics you find a drop-down menu "Title" - select what you want to see here. Play around with the different options and it will soon become apparent what you want to select.As for me, I have selected what is shown in the attached screenshot.