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

Re: Calling a zle widget from a function

Angel Olivera wrote:
> Now, for every prompt that is printed I get a new sched job queued.
> This might get as big as 3600 or more. Do you think that is going to
> be a serious performance penalty on my daily zsh routine?

That's because you're running the "sched" unconditionally to schedule
a new task, even if the function is called from precmd.  It would
definitely be better to avoid that.  You can delete any existing
scheduled job with something like:

sched | while read line; do
  if [[ $line = *clear-zle-screen* ]]; then
    sched -${line%% *}

(It would be nice if sched provided an array to access scheduled events
but it doesn't.  That's an easy tweak I may look at.)

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview

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