[Top][All Lists]

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

Re: Screen title, not just $WINDOW number, in prompt?

From: Thomas Köhler
Subject: Re: Screen title, not just $WINDOW number, in prompt?
Date: Wed, 31 Aug 2005 05:39:26 +0200
User-agent: Mutt/1.5.4i

Steven Brown wrote:
> I'd like to set the title I've assigned a given window (via C-a A) in my
> prompt just like I can currently set $WINDOW.  Is there a way to do
> this?  I read the manual section on setting screen titles, but it seemed
> to be from an xterm title perspective and also melted my brain. :)

I'm not sure I understand your request (how do you set $WINDOW?),
but maybe you just want to
    echo -e -n '\033khello world\033\\'
(or put an escape, then k, then your title, then escape and a
backslash into your prompt).

While my .zshrc is set up to echo "zsh (tty-number)" in the
prompt, it also does this fine precmd (which is executed directly
before the current line gets executed):

TTYSTRING=$(tty|sed -e 's,/dev/,,' -e 's/tty//')

function preexec {
   if [ "$TERM" = "screen" ] ; then 
      local y
      y=(${(s: :)1})
      echo -e -n "\033k$y[1] ($TTYSTRING)\033\\"


 Thomas Köhler       Email:       address@hidden
     <><             WWW:    
                     IRC:                           tkoehler
                     PGP public key available from Homepage!

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]