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

Re: Zsh clears prompt line. Feature or bug?



On Apr 8, 10:43am, Oliver Kiddle wrote:
} Subject: Re: Zsh clears prompt line. Feature or bug?
}
}   precmd() { print -n "${(l.$COLUMNS.)}\e7${(l.$COLUMNS..\b.)}\e8\015" }
} 
} That's 80 spaces, save cursor position, 80 backspaces, restore cursor.

Doesn't work for me.

For one thing, I have to use ${(l.COLUMNS+COLUMNS..\b.)} to get the
cursor back to where it started, because "\b" counts as 2 characters
in (l.80..\b.) so that only prints 40 of them.  I don't know what you
did differently to get \b to be a backspace *before* it was sized.
Maybe you have a cut'n'paste-o and it should be ${(pl.COLUMNS..\b.)} ?

And even then, my backspaces aren't destructive, so I can still select
the spaces that were printed.

The following works, but only if I have "enable reverse wraparound" on,
lack of which state I don't (yet) know how to detect:

  print -P "${(l.COLUMNS.. .)}${(pl.COLUMNS..\b.)}%E"

} The \015 is not part of it: that resets the font.

Huh?  $'\015' is just $'\r', isn't it?



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