diff options
| author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2017-07-26 14:55:03 +0000 |
|---|---|---|
| committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2017-07-28 15:49:14 +0000 |
| commit | f183ed66c85f26670c5e148e952a6cb3f9a73cfd (patch) | |
| tree | 53deb8299e733cb678df328de4f263b681d12bcb /Completion/Unix | |
| parent | 41471 (tweaked): _svn: Complete propvals in 'propset'. (diff) | |
| download | zsh-f183ed66c85f26670c5e148e952a6cb3f9a73cfd.tar zsh-f183ed66c85f26670c5e148e952a6cb3f9a73cfd.tar.gz zsh-f183ed66c85f26670c5e148e952a6cb3f9a73cfd.tar.bz2 zsh-f183ed66c85f26670c5e148e952a6cb3f9a73cfd.tar.lz zsh-f183ed66c85f26670c5e148e952a6cb3f9a73cfd.tar.xz zsh-f183ed66c85f26670c5e148e952a6cb3f9a73cfd.tar.zst zsh-f183ed66c85f26670c5e148e952a6cb3f9a73cfd.zip | |
41467: Correct completion of 'tmux new <TAB>'.
Reference: window_pane_spawn() in tmux 2.5.
Also, document _cmdstring and _precommand.
Diffstat (limited to 'Completion/Unix')
| -rw-r--r-- | Completion/Unix/Command/_tmux | 2 | ||||
| -rw-r--r-- | Completion/Unix/Type/_cmdambivalent | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 0917da604..5f5bea922 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -526,7 +526,7 @@ _tmux-new-session() { '-t+[specify target session]:session:__tmux-sessions' \ '-x[specify width]:width' \ '-y[specify height]:height' \ - '*:: :_cmdstring' + '*:: :_cmdambivalent' } _tmux-new-window() { diff --git a/Completion/Unix/Type/_cmdambivalent b/Completion/Unix/Type/_cmdambivalent new file mode 100644 index 000000000..1f15d11ab --- /dev/null +++ b/Completion/Unix/Type/_cmdambivalent @@ -0,0 +1,17 @@ +#autoload + +if (( CURRENT == 1 && ${#words} == 1 )); then + # Heuristics to decide whether to complete for system() or for execl(). + local space=' ' + if (( ${${words[CURRENT]}[(I)$space]} )); then + _cmdstring + elif [[ ${${compstate[all_quotes]}[1]} == (\'|\") ]]; then + _cmdstring + else + _command_names -e + fi +elif (( CURRENT == 1 )); then + _command_names -e +else + _normal +fi |
