Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: get the number of active jobs to show in the prompt?



On Oct 3,  4:22pm, Vincent Lefevre wrote:
}
} On Wed, Oct 03, 2001 at 05:43:50 +0000, Bart Schaefer wrote:
} > 
} >    bindkey -M $KEYMAP \\$(([##8](RANDOM % 26 + ##a))) push-line-at-random
} 
} I get errors like
} 
} push-line-at-random:bindkey:5: no such keymap `\163'

Oh, fiddle.  $KEYMAP is only in 4.1.0-dev.  Just drop that `-M $KEYMAP'.

} But I don't understand what you mean.

You might if that sample were working. :-/

} > Aside from the stuff that Deborah mentioned, most of which is correct,
} > there's the question of what to do when [...]
} 
} I still don't understand the problem.

There are two issues:  One, I think it's a bad idea in the first place
because its potentially very disruptive to the interactive experience.
Imagine how you'd feel using, say, "vi" if it were to exit in the middle
of you typing a sentence and then start up again with the text you were
editing possibly shifted to another part of the screen.

It's another matter if this happens on an explicit user action -- you
could create your own widget that would redraw the prompt, and bind it
to ctrl-L or something.

Two, even if I didn't think the resulting interactive experience would
be nasty, I don't think the expected benefit is worth the implementation
effort.  There's much more state to save/restore than just the contents
of the editor buffers, and in the case of a user-defined widget it may
not even be possible to know what state needs to be saved and restored.

} > 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.

What I meant was, it puts the equivalent information somewhere that you
can see it, even though it's not exactly the implementation that you
most desire.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author