set tab title with ssh host

1,168 views
Skip to first unread message

Phil Cruz

unread,
Nov 20, 2019, 5:40:30 PM11/20/19
to iterm2-discuss
I'm connecting to an EC2 instance with ssh. I connect lik:


but the tab title shows "ubuntu@ip-123-44-57-111" which is the private IP of the server. If I'm connected to different servers I can't easily tell by the IP. I went onto the server and modified .bashrc so the prompt shows "ubu...@mydomain.com" yet the iTerm tab title still shows the IP. 

How can I get the tab title to show the domain name and not the IP?

Thanks,
Phil

Phil Cruz

unread,
Nov 20, 2019, 6:00:51 PM11/20/19
to iterm2-discuss
I should mention that I also use oh-my-zsh. Not sure how that plays into this. 

George Nachman

unread,
Nov 23, 2019, 8:47:22 PM11/23/19
to iterm2-...@googlegroups.com
Most likely the title's being set by a control sequence.

I would recommend writing a trigger that detects the hostname and sets the hostname:

image.png

You'll need to come up with the right regex, of course.

Once you've done that, you can turn off the ability to set titles by control sequence and add the hostname to the tab title:

Screen Shot 2019-11-23 at 5.46.23 PM.png

--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iterm2-discuss/8fe88c34-feb7-4e1b-b9d0-09e6e31a4109%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages