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 Wed, Oct 03, 2001 at 15:11:04 +0000, Bart Schaefer wrote:
> 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.

But this is not caused by calling a function when the prompt is
redisplayed. This is caused by the NOTIFY option. And any user
can disable it. In my case, a job shouldn't terminate when I'm
typing something in zle, or something bad happened.

Perhaps I could disable NOTIFY when zle is active and use TRAPCLD with
zle -M in this case. Is it possible? For instance with a setopt nonotify
in precmd and a setopt notify in preexec?

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

How can I do that (to rebuild the prompt when clear-screen is called)?

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

OK.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - 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



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