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

xterm/rxvt title expansion

Hi there,

I'm having trouble getting title expansion to work in rxvt-2.6.4. $TERM
is "rxvt"; I'm using Thomas Dickey's rxvt termcap entry (IOW, I do not
use the common FreeBSD xterm-color hack), but I can see similar behavior
in xterm (XFree86 4.0.3(156)) with TERM=xterm.

I used a slightly modified version of the chpwd() function from the FAQ,
but strange things happen:

  chpwd() {
    [[ -t 1 ]] || return
    case $TERM in
      *xterm*|rxvt*) print -Pn "\e]2;%~\a"

With the chpwd() above (but the -n switch removed), this is what I get:

roman@roman ~ > cd /usr                                          101:0
roman@roman /usr > cd /usr/local                                 102:0
roman@roman /etc/X11 > history                                   105:0
  101  cd /usr
  102  cd /usr/local
  103  cd /etc
  104  cd /etc/X11

The second cd (!102) displays the third prompt below it, but from then on,
the third prompt just gets rewritten, and the string printed by chpwd()
changes like so:

sr/local -> tc/local -> tc/X11al

In xterm, the prompts continue to be displayed below each other; other
than that, the behavior is the same (with -n, the string is eaten by
"promptcr", without it, it's displayed before the prompt with the first
two characters eaten.

What's up, and what should I do to get it to work?


1:11PM up 8 days, 3:37, 13 users, load averages: 0.29, 0.35, 0.16

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