Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
promptcr workaround
- X-seq: zsh-workers 20896
- From: Karl Chen <quarl@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: promptcr workaround
- Date: Tue, 01 Mar 2005 00:17:43 -0800
- Cancel-lock: sha1:56TkFy7X2WXQUkdKg1OR3WdtLyo=
- Gmane-from: 1
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Reply-to: quarl+dated+1110096615.ea06d0@xxxxxxxxxxxxxxxx
- Sender: news <news@xxxxxxxxxxxxx>
I've always been unsatisfied with the answer to FAQ entry
3.23 "How do I prevent the prompt overwriting output when there is
no newline?" I dislike zsh's promptcr behavior both on and off.
I don't like silently losing the last line nor having a messed-up
prompt, and didn't like adding an extra newline on every command.
Here's a way to simulate adding the \n only when necessary:
function precmd {
echo -n ${(l:$COLUMNS:::)}
}
This prints $COLUMNS spaces. Iff there's any output on the line
already, it'll wrap to somewhere on the next line. So when zsh
prints the \r it'll always erase only spaces.
--
Karl 2005-03-01 00:10
Messages sorted by:
Reverse Date,
Date,
Thread,
Author