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

Re: [BUG] queueing_enabled grows infinitely when in .recursive-edit



Thanks for the patch I've devoted much time to this. I've tested the
patch and it works. Noted one thing. Initial calc_timeout() in
raw_getbyte() can return with ZTM_NONE while there are scheduled
functions, often after Ctrl-C in .recursive-edit. Added debug prints:

            } else if (diff > 0) {
                exp100ths = diff * 100;
                if (tmoutp->tp != ZTM_KEY ||
                    exp100ths < tmoutp->exp100ths) {
                    tmoutp->exp100ths = exp100ths;
                    tmoutp->tp = ZTM_FUNC;
                } else {
                    // MY DEBUG
                    _F = fopen("/tmp/recursive.txt", "a+");
                    fprintf( _F, "-- calc_timeout ZTM_FUNC condition not meet"
                     " tmoutp->tp[%d], exp100ths[%d] < tmoutp->exp100ths[%d]\n",
                     tmoutp->tp, exp100ths, tmoutp->exp100ths);
                    fclose(_F);
                }
            } else {
                _F = fopen("/tmp/recursive.txt", "a+");
                fprintf( _F, "-- calc_timeout diff[%d] > 0 condition
not meet\n", diff);
                fclose(_F);
            }

And obtain following logs:

raw_getbyte() - queueing_enabled (0)
-- calc_timeout do_keytmout[0], keytimeout[40]
-- calc_timeout timedfns != NULL
-- calc_timeout diff[0] > 0 condition not meet
-- ^^^ INIT calc_timeout tmout.tp(0) ZTM_NONE(0) ZTM_KEY(1) / BEGIN
RAW_GETBYTE() zle_main.c

It looks like calc_timeout handles diff < 0 and diff > 0 but not diff
== 0? in the "INIT" log "tmout.tp(0)" is the value (0 == ZTM_NONE)
returned from ^^^ up calc_timeout(), and it's not ZTM_FUNC like it
rather should be (timedfns != NULL).

Best regards,
Sebastian Gniazdowski



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