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

Re: REPORTTIME=0 with the option to disable for tab completion



On Wed, 17 Jan 2018 15:18:16 +0000
Josh Junon <junon@xxxxxxx> wrote:
> Recently discovered the `REPORTTIME` environment variable and have found it
> invaluable to my workflow.
> 
> However, it appears to run even for tab completion as well. While I
> understand the reasoning behind it, it makes tab completion kind of
> pointless since the entire screen fills with `time` output.
> 
> Could there be a way to have `REPORTTIME=0` enabled without having it
> run/output anything upon tab completion?

It's not special, so I think you can simply do

diff --git a/Completion/compinit b/Completion/compinit
index c345ceb..f0f8421 100644
--- a/Completion/compinit
+++ b/Completion/compinit
@@ -175,7 +175,9 @@ typeset -gH _comp_setup='local -A _comp_caller_options;
              exec </dev/null;
              trap - ZERR;
              local -a reply;
-             local REPLY'
+             local REPLY;
+             local REPORTTIME;
+             unset REPORTTIME'
 
 # These can hold names of functions that are to be called before/after all
 # matches have been generated.



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