From: Vincent Lefevre <vincent@vinc17.org>
To: zsh-users@sunsite.dk
Subject: Re: get the number of active jobs to show in the prompt?
Date: Wed, 3 Oct 2001 16:22:46 +0200 [thread overview]
Message-ID: <20011003162246.C32766@greux.loria.fr> (raw)
In-Reply-To: <1011003054350.ZM25561@candle.brasslantern.com>
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 <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 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
next prev parent reply other threads:[~2001-10-03 14:23 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-01 5:56 Drew Perttula
2001-10-01 6:09 ` Goran Koruga
2001-10-01 6:12 ` Sweth Chandramouli
2001-10-01 6:37 ` Phil Pennock
2001-10-01 6:59 ` Drew Perttula
2001-10-01 7:08 ` Sweth Chandramouli
2001-10-01 8:28 ` Deborah Ariel Pickett
2001-10-01 9:04 ` Phil Pennock
2001-10-01 17:44 ` Vincent Lefevre
2001-10-02 15:43 ` Bart Schaefer
2001-10-02 16:13 ` Vincent Lefevre
2001-10-02 23:25 ` Deborah Ariel Pickett
2001-10-02 23:29 ` unsubscribe me Matthew Lyon
2001-10-03 0:06 ` get the number of active jobs to show in the prompt? Vincent Lefevre
2001-10-03 5:43 ` Bart Schaefer
2001-10-03 14:22 ` Vincent Lefevre [this message]
2001-10-03 14:59 ` Vincent Lefevre
2001-10-03 15:11 ` Bart Schaefer
2001-10-03 15:35 ` Vincent Lefevre
2001-10-03 15:58 ` Bart Schaefer
2001-10-03 16:47 ` Vincent Lefevre
2001-10-03 17:09 ` Bart Schaefer
2001-10-03 19:34 ` Vincent Lefevre
2001-10-03 20:01 ` Bart Schaefer
2001-10-03 20:08 ` Vincent Lefevre
2001-10-03 21:46 ` Bart Schaefer
2001-10-03 21:51 ` Bart Schaefer
2001-10-03 23:15 ` Vincent Lefevre
2001-10-04 0:05 ` 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=20011003162246.C32766@greux.loria.fr \
--to=vincent@vinc17.org \
--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).