Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Number of jobs in prompt
- X-seq: zsh-users 4396
- From: Michal Politowski <mpol@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Re: Number of jobs in prompt
- Date: Fri, 19 Oct 2001 00:01:05 +0200
- In-reply-to: <20011018234853.C5311@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20011018234853.C5311@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Thu, 18 Oct 2001 23:48:53 +0200, Jesper Holmberg wrote:
> I would like to have the current number of (background) jobs displayed
> in my prompt, but I can't find any variable for this. Would it still be
> possible to achieve this?
The zsh/parameter module provides three job-related associative arrays:
jobdirs, jobtexts and jobstates.
So eg. I load the module:
zmodload -i zsh/parameter
have in my prompt the sequence:
%(1v.(bg %v%).)
and have the following precmd defined:
precmd() { psvar[1]=$#jobtexts; [[ $#jobtexts -eq 0 ]] && psvar[1]=(); }
--
Michal Politowski -- mpol@xxxxxxxxxxxxxx
Warning: this is a memetically modified message
Messages sorted by:
Reverse Date,
Date,
Thread,
Author