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

Re: get the number of active jobs to show in the prompt?



On Mon, Oct 01, 2001 at 11:04:54 +0200, Phil Pennock wrote:
> zmodload zsh/parameter
> function precmd { [... all the other bits ...]
> 	psvar[2]=$#jobstates; [[ $psvar[2] -eq 0 ]] && psvar[2]=()
> }
> and then in PS1: %(2v:<+%2v>:-)

There is a small problem, though: When a job terminates and the prompt
is reprinted, precmd isn't called and the prompt isn't rebuilt, so that
I still get the old prompt. I'd prefer to get a new prompt (a bit like
when I type [Return]). Is there an option to have this behaviour?

-- 
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