Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 07-01-2005, 07:55 AM   #1
Registered: Oct 2004
Location: Portugal
Distribution: Debian, Slackware
Posts: 78

Rep: Reputation: 15
xterm title after quittin ssh sessions

Hello, I have Slack10.1 with fluxbox0.9.13. I use xterm and when I logon via ssh to a remote machine the xterm title becomes the user and the host of that machine, but when I exit the ssh session, the xterm title remains. I want the normal title of xterm before the ssh session.

Anyone can't help?
Old 07-01-2005, 09:27 PM   #2
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
It seems that the remote site that you connect to sets your xterm title. You can set it with something like:

echo -ne "\033];xterm\007"'
or you could add something like:

PROMPT_COMMAND='echo -ne "\033];xterm\007"'
to your /etc/profile (or your ~/.bash_profile) file on your local machine. PROMPT_COMMAND allows some nice tricks too if you like. I have:

PROMPT_COMMAND='echo -ne "\033];Terminal (`temp=$(tty) ; echo ${temp:5}`) -    `pwd`\007"'
in my /etc/profile. This sets the titlebar to show the line of the terminal and the current working directory, so what I normally see is something like: Terminal (pts/n) - /home/myusername

Using PROMPT_COMMAND also ensures that the titlebar gets automatically reset when you exit ssh because it gets run every time that bash displays your prompt.

Last edited by alienDog; 07-01-2005 at 09:29 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH help, concerning sessions frokid879 Linux - Newbie 4 11-11-2005 12:22 PM
Set the Xterm title to reflect the current time ! Bonch Linux - Newbie 11 10-25-2004 05:50 PM
How to set title in xterm according to what program running ? tvn Linux - General 1 07-25-2004 08:58 PM
custom xterm title when already defined in .bashrc brian0918 Linux - Software 1 06-01-2004 12:17 PM
dead ssh sessions babroga Linux - Newbie 1 03-03-2002 09:16 AM

All times are GMT -5. The time now is 05:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration