1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-08-21 06:11:09 +02:00

33223: discard stderr except when _complete_debug is in progress.

This commit is contained in:
Barton E. Schaefer 2014-09-23 20:31:31 -07:00
parent 95a6d965c5
commit 5a2668a6ac
2 changed files with 20 additions and 2 deletions
ChangeLog
Completion/Base/Utility

View file

@ -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

View file

@ -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}>&-
}