From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6382 invoked by alias); 20 Sep 2011 19:13:02 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16390 Received: (qmail 14038 invoked from network); 20 Sep 2011 19:13:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at smaf.org does not designate permitted sender hosts) MIME-Version: 1.0 In-Reply-To: References: <25285513.300695.1316475776167.JavaMail.servlet@pustefix152.kundenserver.de> Date: Tue, 20 Sep 2011 21:04:49 +0200 Message-ID: Subject: Re: named jobs in RPROMPT From: Julien Jehannet To: Daniel Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2011/9/20 Daniel : > (...) > But thanks anyway, because now I tried to minimize my code even more. > > =C2=A0setopt promptsubst > Now consider: > =C2=A0RPROMPT=3D'"$jobstates"' > and > =C2=A0my_jobs() { print $jobstates } > =C2=A0RPROMPT=3D'"$(my_jobs)"' > > The first one display the jobstates array, the second doesn't. Also, runn= ing > my_jobs from the prompt does display the array. Could this be because ins= ide > the function, there are no background jobs? It's in a different context, = or > something like that? > > My idea is to have my_jobs print a very compact list of jobs, fitting in > the right prompt. I would reset RPROMPT periodically instead. Maybe something similar to : % my_jobs() { RPROMPT=3D$jobstates } % precmd_functions=3D(my_jobs) But this is just for testing because you will certainly clutter your rprompt this way. Don't forget that if the line is too long, the content will not be displaye= d. --=20 J u l i e n=C2=A0 =C2=A0 J e h a n n e t