LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   xterm title after quittin ssh sessions (https://www.linuxquestions.org/questions/slackware-14/xterm-title-after-quittin-ssh-sessions-339014/)

bujecas 07-01-2005 06:55 AM

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?

alienDog 07-01-2005 08:27 PM

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

Code:

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

Code:

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:

Code:

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.


All times are GMT -5. The time now is 12:07 AM.