在我的 cygwin 安装上运行 zsh + oh-my-zsh。每当我开始一个新的 ZSH 会话(新的 mintty、tmux 等)时,它都会输出下面的文本。我不认为它会影响 ZSH 的性能,但它非常烦人。
add-zsh-hook () {
emulate -L zsh
local -a hooktypes
hooktypes=(chpwd precmd preexec periodic zshaddhistory zshexit zsh_direc tory_name)
local usage="Usage: $0 hook function\nValid hooks are:\n $hooktypes"
local opt
local -a autoopts
integer del list help
while getopts "dDhLUzk" opt
do
case $opt in
(d) del=1 ;;
(D) del=2 ;;
(h) help=1 ;;
(L) list=1 ;;
([Uzk]) autoopts+=(-$opt) ;;
(*) return 1 ;;
esac
done
shift $(( OPTIND - 1 ))
if (( list ))
then
typeset -mp "(${1:-${(@j:|:)hooktypes}})_functions"
return $?
elif (( help || $# != 2 || ${hooktypes[(I)$1]} == 0 ))
then
print -u$(( 2 - help )) $usage
return $(( 1 - help ))
fi
local hook="${1}_functions"
local fn="$2"
if (( del ))
then
if (( ${(P)+hook} ))
then
if (( del == 2 ))
then
set -A $hook ${(P)hook:#${~fn}}
else
set -A $hook ${(P)hook:#$fn}
fi
if (( ! ${(P)#hook} ))
then
unset $hook
fi
fi
else
if (( ${(P)+hook} ))
then
if (( ${${(P)hook}[(I)$fn]} == 0 ))
then
set -A $hook ${(P)hook} $fn
fi
else
set -A $hook $fn
fi
autoload $autoopts -- $fn
fi
}
compdump () {
# undefined
builtin autoload -XUz
}
compinit () {
emulate -L zsh
setopt extendedglob
typeset _i_dumpfile _i_files _i_line _i_done _i_dir _i_autodump=1
typeset _i_tag _i_file _i_addfiles _i_fail=ask _i_check=yes _i_name
while [[ $# -gt 0 && $1 = -[dDiuC] ]]
do
case "$1" in
(-d) _i_autodump=1
shift
if [[ $# -gt 0 && "$1" != -[dfQC] ]]
then
_i_dumpfile="$1"
shift
fi ;;
(-D) _i_autodump=0
shift ;;
(-i) _i_fail=ign
shift ;;
(-u) _i_fail=use
shift ;;
(-C) _i_check=
shift ;;
esac
done
typeset -gA _comps _services _patcomps _postpatcomps
typeset -gA _compautos
typeset -gA _lastcomp
if [[ -n $_i_dumpfile ]]
then
typeset -g _comp_dumpfile="$_i_dumpfile"
else
typeset -g _comp_dumpfile="${ZDOTDIR:-$HOME}/.zcompdump"
fi
typeset -ga _comp_options
_comp_options=(bareglobqual extendedglob glob multibyte nullglob rcexpan dparam unset NO_allexport NO_aliases NO_cshnullglob NO_cshjunkiequotes NO_errexi t NO_globsubst NO_histsubstpattern NO_ignorebraces NO_ignoreclosebraces NO_kshgl ob NO_ksharrays NO_kshtypeset NO_markdirs NO_octalzeroes NO_shwordsplit NO_shglo b NO_warncreateglobal)
typeset -g _comp_setup='local -A _comp_caller_options;
_comp_caller_options=(${(kv)options[@]});
setopt localoptions localtraps ${_comp_options[@]};
local IFS=$'\'\ \\t\\r\\n\\0\''
exec </dev/null;
trap - ZERR
local -a reply
local REPLY'
typeset -ga compprefuncs comppostfuncs
compprefuncs=()
comppostfuncs=()
: $funcstack
compdef () {
local opt autol type func delete eval new i ret=0 cmd svc
local -a match mbegin mend
emulate -L zsh
setopt extendedglob
if (( ! $# ))
then
print -u2 "$0: I need arguments"
return 1
fi
while getopts "anpPkKde" opt
do
case "$opt" in
(a) autol=yes ;;
(n) new=yes ;;
([pPkK]) if [[ -n "$type" ]]
[受正文限制]