[lug] Gnome Terminal Dynamically-set title problem

Dean Brissinger brissing at kaidok.com
Thu Jun 30 20:42:47 MDT 2005


On Thursday, June 30, 2005 8:12 PM, Michael J. Hammel wrote:

> On Thu, 2005-06-30 at 19:45 -0600, Ferdinand Schmid wrote:
>> You can configure it in the Edit Profile -> Title and Command tab to
>> "Dynamically-set title:".  However, this only works for me when I ssh
>> into a very old SuSE Linux machine.  Any of the newer machines must
>> not return the proper status to the shell because my title update
>> fails. 
>
> Most X terminals support escape sequences for this.  I've been doing
> it like this for years in my .bashrc (or kshrc as the case may be): 

A T Cshell example here for a .cshrc:

if ( "$?tcsh" ) then
  if ( $term == "xterm" ) then
    alias cwdcmd 'echo -n "^[]2;${HOST}:  -`whoami`-  `echo ${cwd} | sed
s:/home/brissing:~:g`^G"'
    alias precmd 'cwdcmd'
    cd . # Update it now.
  endif
endif


In particular, the escape sequience '[ESC] + ] + 2 + ;' is to get the
attention of your Xterm.  Then whatever you put between it and '[ctrl] + G'
will be placed in to your Xterm's title bar.  Most editors will let you put
escape characters in your .cshrc by first pressing ctrl-v.  So in VI's
insert mode 'ctrl-v [esc]' would generate the esc key sequence and 'ctrl-v
ctrl-g' would generate the closing sequence.





More information about the LUG mailing list