I did some digging and found the answer for myself. Well, the way I have found to accomplish my gaol is not elegant, but it will work to get the job done.
First, you need to have the "set-titles" option turned on in your .tmux.conf file. As well as the appropriate title string:
set -g set-titles on
set -g set-titles-string '#T'
However, if you implement this, you will immediately notice that it doesn't work. The problem is that this only sends the title string up stream if it starts in an xterm variant (tmux/screen TERM variable is "screen*"). So, when starting a nested tmux session, you must fool the terminal by resetting the variable. The following example will keep the TERM suffix (e.g. "-256color").
TEMP_TERM=$TERM
TEMP_TERM_SUFFIX=${TERM#$(echo $TERM | cut -f 1 -d'-')}
TERM="xterm${TEMP_TERM_SUFFIX}"
I am not sure if it matters, but I think it is smart to reset TERM back after closing tmux (so save it into a temp variable). Using this, a simple shell script can be made to open a nested tmux session that sends the #T title variable upstream to it's parent sessions.
This all works, but is somewhat of a pain considering that work must be done to ensure infinite nesting loops aren't created in the event that we automatically start our shell up in tmux. If anyone has a better solution I would love to here it as well!
You can use the tmux option set-titles
In my .tmux.conf I have the following line:
set-option -g set-titles on
You will need to restart the tmux server (kill existing sessions) or re-source the file before the change in your config takes effect. You can also run this for an existing session with <prefix>:set-option set-titles on
Best Answer
I use this script, which is
exec
d whenever my shell starts as a login shell. You'll probably want to edit this a bit...Relevant section in my .zshrc