diff options
Diffstat (limited to 'Completion/Zsh')
-rw-r--r-- | Completion/Zsh/Context/_condition | 2 | ||||
-rw-r--r-- | Completion/Zsh/Type/_file_descriptors | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Completion/Zsh/Context/_condition b/Completion/Zsh/Context/_condition index b6a4eff7a..46f8467b7 100644 --- a/Completion/Zsh/Context/_condition +++ b/Completion/Zsh/Context/_condition @@ -6,6 +6,8 @@ if [[ "$prev" = -o ]]; then _tags -C -o options && _options elif [[ "$prev" = -([a-hkprsuwxLOGSN]|[no]t|ef) ]]; then _tags -C "$prev" files && _files +elif [[ "$prev" = -t ]]; then + _file_descriptors else if [[ "$PREFIX" = -* ]] || ! zstyle -T ":completion:${curcontext}:options" prefix-needed; then diff --git a/Completion/Zsh/Type/_file_descriptors b/Completion/Zsh/Type/_file_descriptors index 3331be82c..3ea94a7b7 100644 --- a/Completion/Zsh/Type/_file_descriptors +++ b/Completion/Zsh/Type/_file_descriptors @@ -19,7 +19,11 @@ if zstyle -T ":completion:${curcontext}:" verbose && [[ -e /proc/$$/fd ]]; then list=( ${list[@]} "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" ) done fi - _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds -else - _wanted file-descriptors expl 'file descriptors' compadd "$@" -a fds + + if (( $list[(I)* $sep ?*] )); then + _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds + return + fi fi + +_wanted file-descriptors expl 'file descriptors' compadd "$@" -a fds |