Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: jobs numbers in prompt
- X-seq: zsh-users 12438
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: "zsh users" <zsh-users@xxxxxxxxxx>
- Subject: Re: jobs numbers in prompt
- Date: Wed, 16 Jan 2008 14:31:45 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=GL1nSf2FUSipwHffB7oU8pjYe/+M3CJcz2FE/nw3UOk=; b=UO4MRDKIc7Nh6obnpy1rEalRQKA870CMxRY309+9KVC+oQbqxCDMu425No5JK83AA6OcN427JvbnuoDk8hMTsQthnt0rgD/Gd7OU0gm8QIVW5at0m0KbjPayRJdasu/fa4pBl/UAegRqw8dHv4CWPbNGVst7KXyHfnj0ZOAudq8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WuPOKo2r0f0ZE47265jp52XtttF5Qa2+KbMg4v3WV9ngr/E/YoyGGES3FzZufbhHnZ1DAagmnmFUnM2MVEfs2vfkfwGtJoHvZzkGI+erhCotWFd9Aetoub5l//ty6Fa6z8d9QFaIHo6dBlWa3fzr3JIpcy030O3nV6LjlnqIK2Q=
- In-reply-to: <20080116092425.GA29912@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20080116092425.GA29912@xxxxxxx>
On 16/01/2008, Miek Gieben <miek@xxxxxxx> wrote:
> Hello,
>
> In my current prompt I have a list of background jobs (if there are
> any). This works like this:
> myjobs=${(pj:\,:)${(k)jobstates}}
>
> And gives a list like: 1,2
>
> Now my question, is there any possibility to include the current job
> (+ sign) and previous job (- sign) in this output? Like this: 1-,2+
>
> Is this possible? If been fighting with $jobstates all week, but I've
> been unable to extract multiple fields from this array.
Does this work?
myjobs=();for a (${(k)jobstates})
{j=$jobstates[$a];myjobs+=($a"${${(@s,:,)j}[2]}")};myjobs=${(j:,:)myjobs}
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author