From: Jesper Holmberg <jesper.holmberg.5791@student.uu.se>
To: Zsh-users List <zsh-users@sunsite.dk>
Subject: precmd not being updated when I want
Date: Mon, 8 Sep 2003 22:18:11 +0200 [thread overview]
Message-ID: <20030908201811.GU6280@strindberg.student.uu.se> (raw)
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
next reply other threads:[~2003-09-08 20:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-08 20:18 Jesper Holmberg [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030908201811.GU6280@strindberg.student.uu.se \
--to=jesper.holmberg.5791@student.uu.se \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).