diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2012-03-24 22:49:20 +0000 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2012-03-24 22:49:20 +0000 |
| commit | 511fc6e367e886fda47569acafc8f82ba1265546 (patch) | |
| tree | 7349b1f3c8066c3a480c54dba1762954f1481216 /Completion/Unix/Command/_tmux | |
| parent | 30372: _tmux: redirect errors to /dev/null (diff) | |
| download | zsh-511fc6e367e886fda47569acafc8f82ba1265546.tar zsh-511fc6e367e886fda47569acafc8f82ba1265546.tar.gz zsh-511fc6e367e886fda47569acafc8f82ba1265546.tar.bz2 zsh-511fc6e367e886fda47569acafc8f82ba1265546.tar.lz zsh-511fc6e367e886fda47569acafc8f82ba1265546.tar.xz zsh-511fc6e367e886fda47569acafc8f82ba1265546.tar.zst zsh-511fc6e367e886fda47569acafc8f82ba1265546.zip | |
30368: _tmux: complete arguments to unambiguous partial subcommands
Diffstat (limited to 'Completion/Unix/Command/_tmux')
| -rw-r--r-- | Completion/Unix/Command/_tmux | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 3327b1462..39befe884 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1528,6 +1528,18 @@ function _tmux() { if [[ -n ${_tmux_aliasmap[$tmuxcommand]} ]] ; then tmuxcommand="${_tmux_aliasmap[$tmuxcommand]}" fi + if ! (( ${+functions[_tmux-$tmuxcommand]} )); then + local low high + low=$_tmux_commands[(i)$tmuxcommand*] + high=$_tmux_commands[(I)$tmuxcommand*] + if (( low == high )); then + tmuxcommand=${_tmux_commands[low]%%:*} + elif (( low < high )); then + _message -e "Ambiguous command $tmuxcommand" + else + _message -e "Subcommand $tmuxcommand not known" + fi + fi curcontext="${curcontext%:*:*}:tmux-${tmuxcommand}:" _call_function ret _tmux-${tmuxcommand} fi |
