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

Re: Completion and REPORTTIME



On Sep 20,  2:57pm, Julien Nicoulaud wrote:
} 
} When REPORTTIME, time can be reported on some slow compdefs, which kinda
} breaks output. I think time reporting should be disabled in the context of
} completion functions execution, don't you ?

Hmm.

We should add "local REPORTTIME=0" to _comp_setup in Completion/compinit,
but that only helps for completions that go through _main_complete
(which admittedly is most of them).

It's not practical to make the low-level job control functions aware of
the completion system in order to suppress this there, and a bit ugly
to be simulating "local REPORTTIME" in the C code completion callbacks.
I suppose a generic hook for modules to toggle off time reporting (and
any other semi-automatic shell diagnostics) is a possibility.

On the other hand, the time report is printed to standard error, and it
has so far been the responsibility of the individual completers to do
redirection of stderr when they might produce diagnostics that muddy up
the display.  This is a bit different because the diagnostic is from
the shell itself and could affect any operation under the right set of
circumstances.  Perhaps the completion C entry point(s) should arrange
to close/restore stderr ... I believe things like _complete_debug that
do their own stderr manipulation would still work.  But I'm not very
excited about that idea, either.



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