From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11645 invoked from network); 3 Oct 2001 14:23:48 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Oct 2001 14:23:48 -0000 Received: (qmail 8486 invoked by alias); 3 Oct 2001 14:23:27 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4323 Received: (qmail 8469 invoked from network); 3 Oct 2001 14:23:27 -0000 X-Authentication-Warning: greux.loria.fr: lefevre set sender to vincent@vinc17.org using -f Date: Wed, 3 Oct 2001 16:22:46 +0200 From: Vincent Lefevre To: zsh-users@sunsite.dk Subject: Re: get the number of active jobs to show in the prompt? Message-ID: <20011003162246.C32766@greux.loria.fr> Mail-Followup-To: zsh-users@sunsite.dk References: <20011002181324.A29201@greux.loria.fr> <200110022325.JAA07306@bruce.csse.monash.edu.au> <4ac3633923vincent@vinc17.org> <1011003054350.ZM25561@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1011003054350.ZM25561@candle.brasslantern.com> User-Agent: Mutt/1.3.22.1i X-Mailer-Info: http://www.vinc17.org/mutt_eng.html On Wed, Oct 03, 2001 at 05:43:50 +0000, Bart Schaefer wrote: > This is the sort of thing that sounds good in theory, but will drive you > insane in practice. For some sort of inkling of how it would feel, try > using this: > > function push-line-at-random { > local nested=${(%):-%_} > zle self-insert > print '\n[0] + done pretend a job finished' > bindkey $KEYS self-insert > bindkey -M $KEYMAP \\$(([##8](RANDOM % 26 + ##a))) push-line-at-random > if [[ -n $nested ]] > then > zle push-line-or-edit > zle beep > else > zle push-input > zle send-break > fi > } > zle -N push-line-at-random > bindkey \\$(([##8](RANDOM % 26 + ##a))) push-line-at-random I get errors like push-line-at-random:bindkey:5: no such keymap `\163' But I don't understand what you mean. > Aside from the stuff that Deborah mentioned, most of which is correct, > there's the question of what to do when you're at the "bck-i-search:" > prompt (or other "minibuffer" prompts), or when you're in menu-select, > or when you're in the middle of some long-running user-defined widget > such as incremental-complete-word. I still don't understand the problem. > While someone (not me, this time) is deciding whether they want to > attempt to come up with a clean way to deal with all of this, you might > look at what you can do with "zle -I" and "zle -M". For example: > > TRAPCLD() { zle -I && zle -M "jobs: $#jobstates running" } This doesn't solve my problem: for instance, after a Ctrl-L, the message disappears. I think that the best thing I can do is to put the jobs status directly to the terminal title, and this can be done with TRAPCLD. > It's too bad that this does two redraws (one for the notify output and > again because of `zle -I') but at least it shows the info you want. This is not what I want. I just want the prompt to reflect the jobs status. Currently, my prompt is yellow when there are no jobs, and green when there is at least one job. -- Vincent Lefèvre - Web: - 100% validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des Jeux Mathématiques et Logiques, TETRHEX, etc. Work: CR INRIA - computer arithmetic / SPACES project at LORIA