about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Base/Utility/_call_program17
2 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6fe3be9a9..60dac7ba7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-23  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 33223: Completion/Base/Utility/_call_program: discard stderr
+	except when _complete_debug is in progress.
+
 2014-09-23  Øystein Walle  <oystwa@gmail.com>
 
 	* 33179: Completion/Unix/Command/_git: _git: updates for Git 2.0.0
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}>&-
+
+}