ZSHCOMPCTL(1) General Commands Manual ZSHCOMPCTL(1) (NAME) zshcompctl - zsh (DESCRIPTION) zsh . zshcompsys(1) zshcompwid(1) . compctl . compctl [ -CDT ] options [ command ... ] compctl [ -CDT ] options [ -x pattern options - ... -- ] [ + options [ -x ... -- ] ... [+] ] [ command ... ] compctl -M match-specs ... compctl -L [ -CDTM ] [ command ... ] compctl + command ... options . expand-or-complete-word ( tab ) delete-char-or-list ( EMACS ^D ) compctl . ( ) . (COMMAND FLAGS) . . ( -L) options << >> : command ... . . = . command . 'foo*' foo . . -tn . COMPLETE_ALIASES . -C -D -T . -C . compctl -C ( path ) . -D . compctl -D . -T compctl . ( -x << >> ) . . / ( `~' ) : compctl -T -x 's[~] C[0,[^/]#]' -k friends -S/ -tn friends `~' . C[...] ~ . -L . -M ( -L ) . . no argument compctl options ( ) . + command . -D . -M ( zshcompwid). ( compctl ) . : compctl -M '' 'm:{a-zA-Z}={A-Za-z}' ( ) . (OPTION FLAGS) [ -fcFBdeaRGovNAIOPZEnbjrzu/12 ] [ -k array ] [ -g globstring ] [ -s subststring ] [ -K function ] [ -Q ] [ -P prefix ] [ -S suffix ] [ -W file-prefix ] [ -H num pattern ] [ -q ] [ -X explanation ] [ -Y explanation ] [ -y func-or-var ] [ -l cmd ] [ -h cmd ] [ -U ] [ -t continue ] [ -J name ] [ -V name ] [ -M match-spec ] options . . . (Simple Flags) : -f . -/ (). -c . -F . -B (builtins). -m . -w . -a . -R (). -G . -d -F -B -w -a -R -G . -e ( ) -d -de -F -B -w -a -R -G . -o ( zshoptions(1)). -v . -N (). -A . -I . -O . -p ( ). -Z . -E . -n . -b (bindings). -j (jobs): . kill . -r . -z . -u . (Flags with Arguments) : -k array $array ( `$' ). array . : compctl -k "(cputime filesize datasize stacksize coredumpsize resident descriptors)" limit -g globstring globstring . . `*/' `*(/)' . fignore . . ( globbing . `(either|or)' .) -s subststring subststring ( zshexpn(1)). . fignore . -g . -K function . : . -c -l read . reply ( ) reply . -c -l read . : function whoson { reply=(`users`); } compctl -K whoson talk `talk' . `whoson' `reply=`users`' . -H num pattern num . pattern . num pattern ( `*'). : compctl -D -f + -H 0 '' . (Control Flags) : -Q (metacharacters) . . . (-k) . -P prefix prefix prefix . : compctl -j -P "%" kill `%' kill . -S suffix suffix . . -W file-prefix file-prefix: ( -c -f -/ -g) . : compctl -/ -W ~/Mail maildirs ~/Mail . file-prefix -k . . -q -S AUTO_REMOVE_SLASH . ( ) . -l cmd . `p[...]' `r[...]' `R[...]' ( << >> ) . cmd . cmd . : compctl -x 'r[-exec,;]' -l '' -- find `-exec' `;' ( ) . -h cmd zsh . . -l . cmd . cmd -l . -U . . ( -K) ( -c -l read) . . AUTO_MENU . -y func-or-var func-or-var . . func-or-var $ . -K . . reply . . . . -X explanation explanation . `%n' . . -X ( -J -V) . -X ( ) `%n' . . %B %b %S %s %U %u ( ) %F %f %K %k %{...%} . -Y explanation -X explanation . -K -y . -t continue continue . : (i) -T compctl `-tn' . (ii) + compctl . `-t+' `+' . (iii) ( ) compctl . `-t-' compctl `-' `-tx' `-x' . -J name . . default . . . . : compctl -f -J files -t+ + -v -J variables foo -t+ + . -J . -V name -J . -J files -V files . -1 -V . . -2 -J -V . . -M match-spec . match-spec zshcompwid . (ALTERNATIVE COMPLETION) compctl [ -CDT ] options + options [ + ... ] [ + ] command ... `+' . `+' . `+' . `+' . -t + . << >> . (EXTENDED COMPLETION) compctl [ -CDT ] options -x pattern options - ... -- [ command ... ] compctl [ -CDT ] options [ -x pattern options - ... -- ] [ + options [ -x ... -- ] ... [+] ] [ command ... ] `-x' `+' . pattern options << >> . pattern options -x . . pattern ( <<>>). ( <<>>). `c[...][...]' ( <<>>). . : s[string]... . string . S[string]... s[string] string . p[from,to]... from to ( ) . to to from . : -n n . c[offset,string]... string offset . offset . C[offset,pattern]... c . w[index,string]... index string . . W[index,pattern]... w . n[index,string]... string . index ( ) . index : index - . : compctl -s '`users`' -x 'n[1,@]' -k hosts -- talk @ hosts ( ) . rcp . N[index,string]... n . index string . m[min,max]... min max ( ) . r[str1,str2]... str1 . str2 str1 . str2 str1 . R[str1,str2]... r . q[str]... str `s' str `d' str `b' . (EXAMPLE) compctl -u -x 's[+] c[-1,-f],s[-f+]' \ -g '~/Mail/*(:t)' - 's[-f],c[-1,-f]' -f -- mail : mail (( + -f ) ( -f+ )) ( `:t') ~/Mail -f -f . zsh 5.9.2 July 12, 2026 ZSHCOMPCTL(1)