Bug 115209 - tab title in konsole does not revert to default when logging out of remote servers
Summary: tab title in konsole does not revert to default when logging out of remote se...
Status: RESOLVED WORKSFORME
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-27 18:38 UTC by Chris Petersen
Modified: 2006-02-23 23:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Petersen 2005-10-27 18:38:29 UTC
Version:            (using KDE KDE 3.4.92)
Installed from:    Ubuntu Packages
OS:                Linux

Just upgraded to ubuntu and kde 3.4.92 to get the new "set tab title to window title" option to match gnome-terminal's functionality.  It works great, changing the tab title to user@remotehost when I ssh out, but when I disconnect, the tab title stays user@remotehost instead of getting set to user@localhost (even reverting to the default "Terminal" would be better than that).  I'm guessing that konsole just isn't parsing the command prompt for local connections, which it should.

Verified that this isn't distro-specific on a friend's gentoo box, which behaves the same.
Comment 1 Kurt Hindenburg 2005-11-12 11:31:21 UTC
Please post your PS1 from both machines.  I quickly tested this and it seems to work.  I'd like to see what PS1s you are using...

export PS1="\[\033[0;32m\](\[\033[1;34m\]\u\[\033[1;32m\]@\[\033[0;31m\]\h\[\033[0;32m\])-(\[\033[0;36m\]$(date +%H:%M)\[\033[0;32m\])-(\[\033[0;36m\]\w\[\033[0;32m\])\[\033[0;36m\]>\[\033[0;37m\] \[\e]30;\w\a\] \[\e]30;\h:\u \w\a\]"
Comment 2 Chris Petersen 2005-11-12 19:43:19 UTC
user PS1:

\[\033[0;34m\]\u\[\033[36m\]@\[\033[34m\]\h\[\033[0m\]: \[\033[32m\]\w\[\033[0m\] >

root PS1:

\[\033[1;31m\]\u\[\033[22m\]@\[\033[1m\]\h\[\033[0m\]: \[\033[32m\]\w\[\033[0m\] #

These prompts are the same on all boxes I use.  I also just tried yours and it doesn't update the tab title, either.  However, in the process of doing all of this, I ssh'd into my work box from home, and noticed that the tab title didn't change when going INTO that box, either...  The main difference is that only my work box is ubuntu, the rest are fedora.  Maybe there's something configured differently in bash between the various boxes?
Comment 3 Chris Petersen 2006-02-23 23:23:00 UTC
Turns out that fedora puts something in their global bashrc to handle this.  I'm including it here for future reference, but consider the issue closed.

# For interactive shells only
    if [ "$PS1" ]; then
    # Change PROMPT_COMMAND so that it will update window/tab titles automatically
        case "$TERM" in
            xterm*)
                    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
                    ;;
            screen)
                    PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
                    ;;
        esac
    # Redraw the prompt to a better look
        if [ `id -un` = 'root' ]; then
            PS1='\[\033[1;31m\]\u\[\033[22m\]@\[\033[1m\]\h\[\033[0m\]: \[\033[32m\]\w\[\033[0m\] # '
        else
            PS1='\[\033[0;34m\]\u\[\033[36m\]@\[\033[34m\]\h\[\033[0m\]: \[\033[32m\]\w\[\033[0m\] > '
        fi
    # Turn on checkwinsize so we get $LINES and $COLUMNS
        shopt -s checkwinsize
    fi