Thanks to everyone here. I FINALLY figured out what I needed to.
Just having local tab names kept is useless for me because I'm specifically dealing with ssh into boxes.
I use colors in my terminal and I don't want to disable colors as Viljo's solution would do.
Specifically, I'm running multiple vagrant boxes on my local machine and I keep tabs open to several of them. I want to easily set the tab name to the OS version of the vagrant box, and have it stay that way. I keep the tabs open for a long time, so I don't mind setting the name manually, but it needs to not be reset back automatically.
Also, since these are vagrant boxes, I don't want to change settings on them that I will have to change again later if I vagrant destroy
.
So, my findings:
On CentOS 6, the tabname updating code gets placed in $PROMPTNAME
. It can be neutralized and the tabname set in one command by running:
PROMPT_COMMAND="" && printf '\e]1;%s\a' "CentOS 6.6"
On Ubuntu, the tabname updating code is directly in $PS1
; it gets prepended to the already set value of $PS1
by ~/.bashrc
. This can be reverted and the tabname set in one command by running:
PS1="$}" && printf '\e]1;%s\a' "Ubuntu 14.04"