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

Re: Eterm title magic?



Think this may do what I need.

Thanks to all who replied, I like having user@host in a number of
places, nice and visable...


Thus spake Noah L. Meyerhans (noahm@debian.org):

> On Tue, Dec 17, 2002 at 02:09:49PM -0500, Robert L. Harris wrote:
> >   I know with "Eterm -T 'foo'" I can set the title for my Eterm, but is it
> > possible to have it set to whatever is going on in my Term?  A co-worker
> > using xterm has it set up so the title changes if he ssh's to a
> > different box, etc.
> 
> In zsh, I have a prompt defined:
> #based on prompt_suse_setup
> prompt_setup () {
>   PS1="%m:%~$ "
>   PS2="> "
> 
>   prompt_opts=( cr percent )
> 
>   precmd () { 
>        print -n "\e]2;$USER\@$HOSTNAME:$PWD\a\e]1;$USER\@$HOSTNAME\a"
>   }
>   preexec () { }
> }
> prompt_setup "$@"
> 
> 
> The precmd function is what sets the title bar and icon name.
> In bash, I did a similar thing with this code:
> if [ "$BASH" != "" ]; then
>         if [ $TERM = 'xterm' ] || [ $TERM = 'rxvt' ]
>                 || [ $TERM = 'Eterm' ]; then
>           PS1="\[\033]1;\h\007\033]2;\u@\h:$PWD\007\]\h:\w\$ "
>         else
>           PS1="\h:\w$ "
>         fi
> fi
> 
> The weird thing is that in zsh, I can't get the $TERM conditionals to
> have any effect.  precmd() always ends up printing the escape sequence,
> even if I'm at the console.  This results in an annoying beep.  If I log
> in on the console, I end up manually running 'precmd(){}' to redefine
> precmd to be an empty function.
> 
> noah
> 
> -- 
>  _______________________________________________________
> | Web: http://web.morgul.net/~frodo/
> | PGP Public Key: http://web.morgul.net/~frodo/mail.html 





:wq!
---------------------------------------------------------------------------
Robert L. Harris                     | PGP Key ID: FC96D405
                               
DISCLAIMER:
      These are MY OPINIONS ALONE.  I speak for no-one else.
FYI:
 perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'

Attachment: pgp6Ba7m7A2wa.pgp
Description: PGP signature


Reply to: