Operating System - HP-UX
1837595 Members
3372 Online
110117 Solutions
New Discussion

changing server names of xterm status bar (heading)

 
SOLVED
Go to solution
Shivkumar
Super Advisor

changing server names of xterm status bar (heading)

Dear Sirs/Madam,

I use xterm of WRQ reflection software to connect to unix servers. I usually login to a box and from their move to different boxes.

I have noted the status bar headline on top of the xterm window shows the name of the first originally logged in box.

This sometimes causes lots of confusion.
Can any suggest how to overcome this situation ?

Thanks,
Shiv

2 REPLIES 2
Pete Randall
Outstanding Contributor
Solution

Re: changing server names of xterm status bar (heading)

Well, you don't say how you "move to a different box" so that leaves multiple possibilities, but will probably involve the -T option of xterm to set a title for the window.

We do a similar thing with hpterm like this. We have scripts in /usr/local/bin with the same names as the servers. These scripts call another /usr/local/bin script which then does a remsh to the desired server, executes hpterm (or xterm in your case), sets the display and titles the window:
remsh $1 -n /usr/bin/X11/hpterm -display $DISPLAY -ls -title $1 -n $1 -s
b -sl 500 &

Substitue xterm for hpterm in the above and check the options.


Pete

Pete
H.Merijn Brand (procura
Honored Contributor

Re: changing server names of xterm status bar (heading)

You can use the ansi escapes :)
in my .tcshrc I have:

glob " ]0;$LOGNAME@$HOST"":$cwd [$$"":$tty] "
alias cwdcmd 'glob " ]0;'${LOGNAME}'@'${HOST}':$cwd ['$$':'$tty'] "'

The cwdcmd is invoked every time tcsh does a cd, so the title bar is updated to show logname, host, current working directory, shell-PID, and tty

I bet you can achieve the same in any shell

Just in case my escapes are ruined by the forum, here's the line again where you should replace \e with ESCAPE, and \7 with BEL (Ctrl-G)

echo -n "\E]0;$LOGNAME@$HOST"":$cwd [$$"":$tty]\7"
or if your echo does not know of -n
echo "\E]0;$LOGNAME@$HOST"":$cwd [$$"":$tty]\7\c"

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn