You are not logged in.

#1 2007-01-17 12:29:15

PeteMo
Member
From: H'Burg, VA
Registered: 2006-01-26
Posts: 191
Website

bash, screen, and dynamic titles [solved]

I am trying to figure out how to dynamically change the terminal title (urxvt in this case) while in screen.  The following snippet from my ~/.bashrc does this as long as screen is not running:

case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD}07"'
    ;;
esac

This sets the terminal title to "user@hostname: PWD" and is updated when I change directories.  I would like to have the same thing occur while running screen.

According to the screen docs it can be done, but I have not figured out how, nor have I found working examples on the net.  If anyone has any pointers or a working example your help would be much appreciated.

EDIT: I've gotten this working by adding the screen) section to ~/.bashrc:

case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD}07"'
    ;;
screen)
    PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD}07"'
    ;;
esac

And adding the following to ~/.screenrc

hardstatus off

Now obviously this prevents me from having a hardstatus line at the bottom of my screen session.  However, modifing my hardstatus line into a caption line works fine.  So, I'll mark this [solved] and hopefully someone can use this info in the future.
Thanks.

Offline

Board footer

Powered by FluxBB