Thomas Köhler wrote:

> I'm not sure I understand your request (how do you set $WINDOW?),

I just include $WINDOW (which is defined in the environment by screen)
in bash's PS1 (prompt) variable.  E.g.,

if test x"$WINDOW" != x""; then
  SCREEEN_PS1="($WINDOW)"
else
  SCREEEN_PS1=""
fi
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;[EMAIL 
PROTECTED]:\[\033[01;34m\]\w\[\033[00m\]${SCREEEN_PS1}\$

'

This results in the prompt looking like (for screen window 1):

[EMAIL PROTECTED]:~(1)$

What I want to do is instead of it showing the number of the screen, to
have it show the title I've assigned that window via C-a A.  All I need
in order to do this is to know how to access that information from
screen given the $WINDOW number (I can use bash's $PROMPT_COMMAND to set
PS1 dynamically).  E.g.,:

[EMAIL PROTECTED]:~(compile)$

> 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//')
> export TTYSTRING
> 
> function preexec {
>    if [ "$TERM" = "screen" ] ; then 
>       local y
>       y=(${(s: :)1})
>       echo -e -n "\033k$y[1] ($TTYSTRING)\033\\"
>    fi
> }

I played around with this but couldn't seem to get it to react - is this
for setting the title in an xterm?



_______________________________________________
screen-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to