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



mike.fabian@example.com wrote:
>  
> 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'm using fvwm2 as well with bash, and haven't had much luck either. 
I went back to the LG issue #10 article:

---------------------------------------
HOSTNAME=`uname -n`
if [ "$TERM" = "xterm" ] && [ "$0" = "-bash" ]
then
   ilabel () { echo -n "^[]1;$*^G"; }
   label () { echo -n "^[]2;$*^G"; }
   alias stripe='label $HOSTNAME - ${PWD#$HOME/}'
   alias stripe2='label $HOSTNAME - vi $*'
   cds () { "cd" $*; eval stripe; }
   vis () { eval stripe2; "vi" $*; eval stripe;}
   alias cd=cds
   alias vi=vis
   eval stripe
   eval ilabel "$HOSTNAME"
fi
---------------------------------------

which gave me the prompt
^[]2;wormhole - /home/schweiz^G^[]1;wormhole^Gschweiz:~$
and nothing on the title bar.

So then I tried:

PS1='^[]0;\u@example.com $*:\w^G\033[1m[\w]\033[m\n\u@example.com$ '

and my prompt changed to 

^[]0;schweiz@example.com :~^G[~]
schweiz@example.com$ 

with still no change in the title bar.

And then from the bashFAQ

-------------------------------------------------
For example, to write a function to replace `cd' that writes the
hostname and current directory to an xterm title bar, use
something like the following:

  cd()
    {
      builtin cd "$@" && xtitle "$HOST: $PWD"
    }
-------------------------------------------------

I haven't figured that one out yet.

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

And who says I should be outside cleaning the garden
instead of hacking on a title bar;-)
(my wife, that's who :)

Regards,

Jim S.
------------------------------------------------------------------
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