zsh-users
 help / color / mirror / code / Atom feed
* precmd not being updated when I want
@ 2003-09-08 20:18 Jesper Holmberg
  2003-09-08 20:24 ` Wayne Davison
  0 siblings, 1 reply; 7+ messages in thread
From: Jesper Holmberg @ 2003-09-08 20:18 UTC (permalink / raw)
  To: Zsh-users List

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-09-09 16:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-08 20:18 precmd not being updated when I want Jesper Holmberg
2003-09-08 20:24 ` Wayne Davison
2003-09-08 20:31   ` Jesper Holmberg
2003-09-08 20:58     ` Wayne Davison
2003-09-09  1:10       ` Bart Schaefer
2003-09-09  7:05         ` Jesper Holmberg
2003-09-09 16:22           ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).