I'm currently setting my PS1 title with by concatinating three variables in my .bashrc in such a way:
export TERMSERVER=`who am i | awk '{print $NF}' | tr -d ')''('`
if [ -n "$TERMSERVER" ] ; then
PS1_TITLE='\h ($MACHTYPE) - $SHELL[$SHLVL] <-- $TERMSERVER'
else
PS1_TITLE='\h ($MACHTYPE) - $SHELL[$SHLVL]'
fi
export PS1="$PS1_TITLE\n$PS1_LINE\n$PS1_PROMPT"
I also open up several PuTTY and launch a different GNU screen in each PuTTY, each with a session name, eg:
screen -T screen -U -S session-1 (in PuTTY #1)
screen -T screen -U -S session-2 (in PuTTY #1)
I'ld love to see session-1 or session-2 appear in my PuTTY window title, but I can't find a correct .screenrc configuration of hardstring working. I also can't find a method to correctly map the contents of "/var/run/screen/S-user" to my current session. I tried using ${PPID}, but it'll fail if in a subshell.
Excerpt from my current .screenrc:
# Every x seconds, requery window title
backtick 1 600 600 id -un
# The window's title
hardstatus ignore
# *** this is the current window title I use since I can't get what I want.
hardstatus string "%1`@%H"
caption always
caption string "%{= KW}%-w%{= wk}%50>%n %t%{-}%+w%< %=%H %l"
Is there any method to obtain what I want?


