Rename Tab

107 views
Skip to first unread message

Benjamin Metzler

unread,
Nov 5, 2013, 2:51:35 PM11/5/13
to chromiu...@chromium.org
Is there a way to rename tabs to the server name in secure shell?  I will often have multiple terminals open in Chrome and would like to quickly glance at the tab bar to know which one to get for a server.

Thanks,
Ben

Robert Ginda

unread,
Nov 5, 2013, 3:03:50 PM11/5/13
to Benjamin Metzler, chromium-hterm
You can modify your bashrc to set the window title at login.  Add something like `echo -e "\e]0;$(hostname)\a"`.  Some folks use this sequence to update the title as part of PS1.  Search for "terminal window title" for more info.


Rob.


--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/78897e14-fb18-410e-ae02-30f0f774f5a6%40chromium.org.

Benjamin Metzler

unread,
Nov 5, 2013, 3:25:05 PM11/5/13
to chromiu...@chromium.org, Benjamin Metzler
Hi Robert,
I found posts about renaming via the echo command in other discussions (which I really should have mentioned), but when I tried using them, the tab name remains the same.  Even if I open Secure Shell in a separate window,  the title remains as "~" after the command or when I add it to .bashrc.   I've tried this on both Solaris and Cygwin in bash.

Thanks,
Ben

Benjamin Metzler

unread,
Nov 5, 2013, 3:58:34 PM11/5/13
to chromiu...@chromium.org, Benjamin Metzler
Hmm, well I figured it out with the following:
export PS1="\n\[\e[33m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ "
export PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME%%.*}\007"'

The first sets my prompt, while the second sets my title.  It's not quite what I want as I'd like to have it based on the connection instead of the host name, which can different then human readable name used.  Is there a way to set it outside of bash?

Thanks,
Ben
Reply all
Reply to author
Forward
0 new messages