Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
precmd not being updated when I want
- X-seq: zsh-users 6540
- From: Jesper Holmberg <jesper.holmberg.5791@xxxxxxxxxxxxx>
- To: Zsh-users List <zsh-users@xxxxxxxxxx>
- Subject: precmd not being updated when I want
- Date: Mon, 8 Sep 2003 22:18:11 +0200
- Mail-followup-to: Zsh-users List <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
I have this:
precmd() { psvar[1]=$#jobtexts; [[ $#jobtexts -eq 0 ]] && psvar[1]=0; }
PS1="%(1v.%v .)$cpath${end}%# "
which gives me the number of jobs first in my prompt. It works very well.
However, if a job finishes, the number of jobs in the prompt does not
update until I type a new command and hit <enter>. Thus:
0 jesper@strindberg:~% sleep 1 &
[1] 7392
1 jesper@strindberg:~%
[1] + done sleep 1
1 jesper@strindberg:~%
0 jesper@strindberg:~%
Notice how sleep reports it is finished, but the prompt still shows "1".
Only when I hit <enter> on the second to last line, the "1" is turned into
a "0". Is there a way to fix this?
TIA,
Jesper
Messages sorted by:
Reverse Date,
Date,
Thread,
Author