Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: get the number of active jobs to show in the prompt?
- X-seq: zsh-users 4335
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Vincent Lefevre <vincent@xxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: Re: get the number of active jobs to show in the prompt?
- Date: Wed, 3 Oct 2001 14:46:40 -0700
- In-reply-to: <4ac3d14900vincent@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20011002181324.A29201@xxxxxxxxxxxxxx> <200110022325.JAA07306@xxxxxxxxxxxxxxxxxxxxxxxx> <4ac3633923vincent@xxxxxxxxxx> <1011003054350.ZM25561@xxxxxxxxxxxxxxxxxxxxxxx> <20011003162246.C32766@xxxxxxxxxxxxxx> <1011003151104.ZM26311@xxxxxxxxxxxxxxxxxxxxxxx> <20011003173500.A1255@xxxxxxxxxxxxxx> <1011003155807.ZM26499@xxxxxxxxxxxxxxxxxxxxxxx> <20011003184755.A1397@xxxxxxxxxxxxxx> <1011003170926.ZM29592@xxxxxxxxxxxxxxxxxxxxxxx> <20011003213437.A1668@xxxxxxxxxxxxxx> <011003130131.ZM29770@xxxxxxxxxxxxxxxxxxxxxxx> <4ac3d14900vincent@xxxxxxxxxx>
On Oct 3, 10:08pm, Vincent Lefevre wrote:
> > It's not the widget that's doing it. It's the ZLE internal screen refresh
>
> OK, so there could be another flag to tell whether to print "\n" or "\r".
Once again, it's not that simple. It's not just printing a "\n" -- it's
moving the cursor to below the current editing area, which could be many
lines high.
And printing an '\r' instead might still put the new prompt in the middle
of said multi-line area.
At this point Geoff Wing is the right person to continue this discussion
if it's going to be continued, as he's the most recent primary author of
the ZLE screen refresh routines.
Meanwhile, since you know your own prompt doesn't change size, you could
try fooling with something like this:
zmodload -i zsh/termcap
function redraw-prompt {
zle .clear-screen
if (( BUFFERLINES < LINES - 1 ))
then
precmd
echotc sc
echotc ho
print -nP "$PS1"
echotc rc
fi
return 0
}
zle -N clear-screen redraw-prompt
That'll only work for terminals that have sc/rc (save/restore cursor), and
your PS1 better not have %E in it.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author