Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: Changing title in kterm



Michael Casinghino <michael@example.com> writes:

>   On Sat, 12 Dec 1998, Jim Schweizer wrote:
>
>   > kterm -bg black -fg green -ls -title michael@example.com &
>   > 
>   > should give you a kterm with the title michael@example.com, if
>   > that's what you want...
>   > 
>   Apparently there's also some escape to code to change the title bar
>   _after_ invocation.  That way you can have the xterm title always read the
>   current directory, for example.  I haven't gotten it to work yet though.
>   Maybe it's just a myth.

You can do something like this when you use tcsh. The man page
of tcsh explains how to do it:

*Man tcsh*>  cwdcmd  Runs after every change of working directory.  For
*Man tcsh*>          example,  if  the  user  is working on an X window
*Man tcsh*>          system using xterm(1) and  a  re-parenting  window
*Man tcsh*>          manager  that  supports  title bars such as twm(1)
*Man tcsh*>          and does
*Man tcsh*>
*Man tcsh*>              > alias cwdcmd   'echo  -n  "^[]2;${HOST}:$cwd
*Man tcsh*>              ^G"'
*Man tcsh*>
*Man tcsh*>          then  the  shell will change the title of the run-
*Man tcsh*>          ning xterm(1) to be the name of the host, a colon,
*Man tcsh*>          and the full current working directory.  A fancier
*Man tcsh*>          way to do that is
*Man tcsh*>
*Man tcsh*>              >      alias       cwdcmd       'echo       -n
*Man tcsh*>              "^[]2;${HOST}:$cwd^G^[]1;${HOST}^G"'
*Man tcsh*>
*Man tcsh*>          This  will  put the hostname and working directory
*Man tcsh*>          on the title bar but only the hostname in the icon
*Man tcsh*>          manager menu.
*Man tcsh*>
*Man tcsh*>          Note  that  putting  a cd, pushd or popd in cwdcmd
*Man tcsh*>          may cause an infinite loop.  It  is  the  author's
*Man tcsh*>          opinion  that  anyone  doing so will get what they
*Man tcsh*>          deserve.

^[ and ^G are Control-[ and Control-G.

I used this several years ago when I used a 33 Mhz 386 machine running
Linux  with twm as  the window  manager as  a  X-terminal for  a HP-UX
machine.  On the HP  machine I used tcsh  and the above  definition of
cwdcmd. twm displayed the current working directory correctly.

Now I tried whether this feature works on my current Linux system from
the tcsh, but it doesn't. Maybe it is because my window manager is now
fvwm2? I have no idea.

I haven't used tcsh for a long time now, because I prefer zsh or bash.
It looks like these shells don't have a "cwdcmd feature".

Mike
 
PS: From the fortune cookies:

..you could spend *all day* customizing the title bar.  Believe me.  I
speak from experience."
(By Matt Welsh)

-- 
Mike Fabian   mike.fabian@example.com   fabian@example.com   
Termuehlenweg 2, D-40885 Ratingen-Lintorf, Telephone: +49(0)2102/893130

------------------------------------------------------------------
Next Nomikai: 15 January 1999, 19:30 Tengu TokyoEkiMae 03-3275-3691
Next Technical Meeting: 13 February, 12:30               Place: TBD
------------------------------------------------------------------
more info: http://tlug.linux.or.jp                     Sponsor: PHT


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links