Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh and xterm



>PS1="$(print "\033")]2;[ $_U ]%m: %/$(print "\007 \r")$PSB "
>
>and in fact this works for the title but then i have problems with the
>muliline editing (it supposes to have written the title also after the
>prompt and so the line is broken too early).

Yes, you need to indicate to zsh that part of the prompt doesn't take
up any space on the screen:

PS1="%{$(print "\033")]2;[ $_U ]%m: %/$(print "\007 \r")%}$PSB "
     ^^                                                 ^^

But in this case it would be better to use the chpwd feature:

function chpwd {
  print -nP "\033]2;[ $_U ]%m: %/\007"
}

chpwd gets executed every time the current directory changes.  Other
things of this nature can be done using precmd, which is executed
before the prompt is displayed.

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author