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 4329
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: get the number of active jobs to show in the prompt?
- Date: Wed, 3 Oct 2001 18:47:55 +0200
- In-reply-to: <1011003155807.ZM26499@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@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>
On Wed, Oct 03, 2001 at 15:58:06 +0000, Bart Schaefer wrote:
> If notify isn't involved, precmd is already sufficient.
Well, I've always had notify and I do want it.
> If notify is involved, then the fact that the prompt could change
> length and that the current "prompt level" could need to change from
> PS2 or deeper back to PS1, leads to all the objections that have
> been raised.
In my case, the length isn't changed. So, this is not my problem.
> } How can I do that (to rebuild the prompt when clear-screen is called)?
>
> Basically the same way I did it in push-line-at-random:
>
> function redraw-prompt {
> local nested=${(%):-%_}
> # zle .clear-screen # You may or may not want this
I want this, so I uncommented it.
> if [[ -n $nested ]]
> then
> zle .push-line-or-edit
> else
> zle .push-input
> zle .send-break # Force new prompt; sorry about beeping
> fi
> }
> # Pick one:
> # zle -N clear-screen redraw-prompt
> # zle -N redraw-prompt; bindkey '^L' redraw-prompt
This doesn't work: the screen is cleared, but then, the prompt is
printed twice. Replacing "zle .clear-screen" by "clear" almost works.
The problem is that push-line seems to send a \n.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
Messages sorted by:
Reverse Date,
Date,
Thread,
Author