It is currently Tue, 07 Dec 2021 02:29:46 GMT



 
Author Message
 Dynamically changing xterm title bar in tcsh

Does anyone know if the cwdcmd alias feature requires a special option
to be set when tcsh is compiled?  Or are there any other requirements
for getting this to work?  I haven't been able to get this to work on
our Solaris, HPUX or AIX boxes that we have at work, however I have seen
it work on some other Solaris boxes that I have logged into while at
training classes.  Upon setting the cwdcmd alias, it just echos back the
string verbatim to stdout instead of changing the title bar text.  Any
info would be appreciated.

Thanks,
Troy
troy_thom...@cargill.com



 Tue, 03 Oct 2000 03:00:00 GMT   
 Dynamically changing xterm title bar in tcsh

In article <35377598.C72E9...@cargill.com>,
        "Troy R. Thomsen" <troy_thom...@cargill.com> writes:

I think this is what you mean. Aliasing cd to update the prompt
is an obsolete technique.
From my .cshrc

set prompt="%{^[]2;$user@%m^G%}%B%~ > %b"

The ^[ and ^G are Crtl-V ESC and Ctrl-V Ctrl-G respectively
The %{ %} pair protects the xterm escape sequence check the
man page for more in-depth explanation and other % sequences.

My example puts user@host in the title and the current directory,
with ~ abbreviations, in boldface, in the prompt.

HTH

Christian
--
Christian Bauernfeind
Not speaking for Siemens
Not even working for IBM
e-mail: v2bau...@fishkill.ibm.com



 Tue, 03 Oct 2000 03:00:00 GMT   
 Dynamically changing xterm title bar in tcsh

Christian,

Thanks for the info - I didn't know you could update the title bar from the
set prompt statement as well.  However, doing it there doesn't update the
title bar each time you change directories.  I was referring to the cwdcmd
alias that updates the title bar with the current directory (or any other info
you want) ever time you change directories.

Also, thanks to David and Rune who e-mailed me, and between the three of you
helped me gather this info which solved my problem.

The ^[ and ^G are control characters; to enter in vi: ^[ is Ctrl-V ESC  and ^G
is just Ctrl-G.

They also can be entered using: \033 and \007, however the shell variable
"echo_style" must be set to "both".

So, I've tested the following on all three platforms (HP, AIX, Solaris) to
change the title bar and the icon title to the value
"user@host:/current_directory" every time the current directory is changed and
it works on all three:

alias cwdcmd  \
  'echo -n "^[]2; ${USER}@${HOST}:${cwd}^G^[]1;${USER}@${HOST}:${cwd}^G"'

or
set echo_style=both
alias cwdcmd \
  'echo -n "\033]2; ${USER}@${HOST}:${cwd}\007\033]2;
${USER}@${HOST}:${cwd}\007"'

Regards,
Troy



 Sat, 07 Oct 2000 03:00:00 GMT   
 Dynamically changing xterm title bar in tcsh

In article <353CEA33.C5DAF...@cargill.com>,
        "Troy R. Thomsen" <troy_thom...@cargill.com> writes:

True, it will do so after _every_ command. I was unaware of cwdcmd,
clearly this is a better solution.

What I was thinking of is the technique of aliasing cd itself,
which I consider inferior to both.

So I managed to learn something myself in the process, thanks!

Christian
--
Christian Bauernfeind
Not speaking for Siemens
Not even working for IBM
e-mail: v2bau...@fishkill.ibm.com



 Sat, 07 Oct 2000 03:00:00 GMT   
 
   [ 4 post ] 

Similar Threads

1. tcsh xterm title bar quoting

2. display pwd in xterm title bar with tcsh

3. How to change the title of an xterm dynamically

4. dynamically changing xterm title

5. How to change xterm title bar string?

6. Change xterm title bar?

7. Changing the title bar for Xterm Windows!!!!

8. Change title bar in xterm?

9. window title bar and tcsh


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software