From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Cc: Daniel Shahaf <d.s@daniel.shahaf.name>
Subject: [PATCH] Correct completion of 'tmux new <TAB>'.
Date: Thu, 20 Jul 2017 20:58:13 +0000 [thread overview]
Message-ID: <20170720205813.15939-1-danielsh@tarpaulin.shahaf.local2> (raw)
Reference: window_pane_spawn() in tmux 2.5.
Also, document _cmdstring and _precommand.
---
To reproduce:
% touch foo\ bar
% tmux new ls ./foo<TAB>
% tmux new ls\ ./foo<TAB>
Use remain-on-exit (or a script that calls ls and sleeps) to see the difference.
Cheers,
Daniel
Completion/Unix/Command/_tmux | 2 +-
Doc/Zsh/compsys.yo | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
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/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 47b07e85e..47c30843c 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -3014,6 +3014,17 @@ tt(-n), tt(-F), tt(-X) are passed to tt(compadd).
See tt(_description) for a description of var(tag) and var(descr).
)
+findex(_cmdambivalent)
+item(tt(_cmdambivalent))(
+Completes an external command.
+If there is a single argument, complete the command in a single word, like tt(_cmdstring);
+otherwise, complete the command in word-separated arguments, like tt(_precommand).
+)
+findex(_cmdstring)
+item(tt(_cmdstring))(
+Completes an external command as a single argument, as for
+tt(system+LPAR()...+RPAR()).
+)
findex(_complete)
item(tt(_complete))(
This completer generates all possible completions in a context-sensitive
@@ -3214,6 +3225,11 @@ tt(old-menu), see
ifzman(the section `Completion System Configuration' above)\
ifnzman(noderef(Completion System Configuration)).
)
+findex(_precommand)
+item(tt(_precommand))(
+Complete an external command in word-separated arguments, as for
+tt(exec) and tt(/usr/bin/env).
+)
findex(_prefix)
item(tt(_prefix))(
This completer can be used to try completion with the suffix (everything
next reply other threads:[~2017-07-20 21:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-20 20:58 Daniel Shahaf [this message]
2017-07-26 14:55 Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170720205813.15939-1-danielsh@tarpaulin.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).