about summary refs log tree commit diff
path: root/Completion/Builtins/_zpty
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2000-05-25 15:09:04 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2000-05-25 15:09:04 +0000
commitb36b493313a16ae92adc3bd988a2591645f469f6 (patch)
tree03fdf937df56dcdf6da9c3a04280c2d6416a4a29 /Completion/Builtins/_zpty
parent7fb99aadec3921af128b361c047be1b66b5734f3 (diff)
downloadzsh-b36b493313a16ae92adc3bd988a2591645f469f6.tar.gz
zsh-b36b493313a16ae92adc3bd988a2591645f469f6.tar.xz
zsh-b36b493313a16ae92adc3bd988a2591645f469f6.zip
Split _arguments calls into sets to avoid long mutex lists (11579)
Diffstat (limited to 'Completion/Builtins/_zpty')
-rw-r--r--Completion/Builtins/_zpty23
1 files changed, 16 insertions, 7 deletions
diff --git a/Completion/Builtins/_zpty b/Completion/Builtins/_zpty
index f3e271342..de793c814 100644
--- a/Completion/Builtins/_zpty
+++ b/Completion/Builtins/_zpty
@@ -4,15 +4,24 @@ local state line list names expl curcontext="$curcontext"
 typeset -A opt_args
 
 _arguments -C -s \
-  '(-d -w -r -L)-e[echo input characters]' \
-  '(-d -w -r -L)-b[io to pseudo-terminal blocking]' \
-  '(-e -b -w -r -L)-d[delete command]:*:name:->name' \
-  '(-e -b -d -r -L)-w[send string to command]:name:->name:*:strings to write' \
-  '(-e -b -d -w -L *)-r[read string from command]:name:->name:param:_parameters' \
-  '(-e -b -d -w -r)-L[list defined commands as calls]' \
-  '(-r)*::args:_normal' && return 0
+  '(-r)*::args:_normal' \
+ - eb \
+  '-e[echo input characters]' \
+  '-b[io to pseudo-terminal blocking]' \
+ - d \
+  '-d[delete command]:*:name:->name' \
+ - w \
+  '-w[send string to command]:name:->name:*:strings to write' \
+ - L \
+  '-L[list defined commands as calls]' \
+ - r \
+  '(*)-r[read string from command]:name:->name:param:_parameters' && return 0
 
 if [[ $state = name ]]; then
+  if ! zmodload -e zsh/zpty; then
+    _message "zpty module not loaded"
+    return 1
+  fi
   list=( ${${(f)"$(zpty)"}#*\) } )
   names=( ${list%%:*} )
   if zstyle -T ":completion:${curcontext}" verbose; then