From 5a2668a6ac1c433337a4db8bc859b712be6b32f1 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Tue, 23 Sep 2014 20:31:31 -0700 Subject: 33223: discard stderr except when _complete_debug is in progress. --- Completion/Base/Utility/_call_program | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Completion/Base/Utility/_call_program') diff --git a/Completion/Base/Utility/_call_program b/Completion/Base/Utility/_call_program index b038a80bc..b65764827 100644 --- a/Completion/Base/Utility/_call_program +++ b/Completion/Base/Utility/_call_program @@ -1,6 +1,13 @@ #autoload +X -local tmp +local tmp err_fd=-1 + +if (( ${debug_fd:--1} > 2 )) +then exec {err_fd}>&2 # debug_fd is saved stderr, 2 is log file +else exec {err_fd}>/dev/null +fi + +{ # Begin "always" block if zstyle -s ":completion:${curcontext}:${1}" command tmp; then if [[ "$tmp" = -* ]]; then @@ -10,4 +17,10 @@ if zstyle -s ":completion:${curcontext}:${1}" command tmp; then fi else eval "$argv[2,-1]" -fi +fi 2>&$err_fd + +} always { + +exec {err_fd}>&- + +} -- cgit v1.2.3