Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 1/2] _tmux: Complete only attached sessions for detach-session.
- X-seq: zsh-workers 41566
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 1/2] _tmux: Complete only attached sessions for detach-session.
- Date: Fri, 18 Aug 2017 04:23:44 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=HUiiJX Ckc1Fasd4I+tdvNFq1ZUmDEzgDkhS4Tw5fdeM=; b=MMlYb2+gZxEEj5VXZABCaD D/hrAzC3ETsTbQq7GJh9bEWeSg6KTfIdxNgjGJ7AmppqFDmccou67ZlriGHoRXTX QZHx4IAbshsWx94mXMDfJiGFPq3LOlznye/jzS18KvNObvHaIy1x85HWNO3Jvnlg 8Sr8pYWSbZdZe7j7swX1tVZC1oCOSwIM1ogQg8NkwSdeIYaB9eAH2LLcrClXtc3z OEDZFfTGDMZRYe43r9sNZL2OwwX8Kx5hgT7eRFYg4Fj2REK6dHMmWQPF+ZfBRUfV LQL24i+8AgsbA+2fmheIivHESoOEr9Cr9yiMR7iFeR1a77mb9G6QMacyS4C8lsLQ ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=HUiiJX Ckc1Fasd4I+tdvNFq1ZUmDEzgDkhS4Tw5fdeM=; b=PeKDSHC0Aiaa2Ast17oa5a p3iD2gH4KtFsGrUyQ9Ta7gbeIyQ21WcKozXvFIRll4gTUShK7yGrD+8kB+1mit8j cD39+E6ILj4yhkxEzNXfGtRXmbrb3Ehhc5GhiVN3iEdT/2FpI8qOX3h8qO1Joen4 s8REFDbJGigQUEbFdhTrbfFeyQMxspA/sBRVKaVk4/I1Rw9XHedAOQCK4n9ulUOc qpYQE9pxEpfH41fGtFOuzBxfQLVJW0pwuTDbpW3mE520q3INeYJ1sqI6rKzsJHme wetzikUma4noUK/LeLvOcd47BdMDSxK8E6e9of5Uqf0B3cap0UIwE3mWmnfQH7ew ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
Completion/Unix/Command/_tmux | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux
index 7999be3eb..48fe29aee 100644
--- a/Completion/Unix/Command/_tmux
+++ b/Completion/Unix/Command/_tmux
@@ -302,7 +302,7 @@ _tmux-detach-client() {
_arguments -s \
'-a[kill all clients except for the named by -t]' \
'-P[send SIGHUP to parent process]' \
- '-s+[specify target session and kill its clients]:session:__tmux-sessions' \
+ '-s+[specify target session and kill its clients]:session:__tmux-sessions-attached' \
'-t+[specify target client]:client:__tmux-clients'
}
@@ -1366,6 +1366,13 @@ function __tmux-sessions() {
_describe -t sessions 'sessions' sessions "$@"
}
+function __tmux-sessions-attached() {
+ local -a sessions
+ sessions=( ${${(f)"$(command tmux 2> /dev/null list-sessions)"}/:[ $'\t']##/:} )
+ sessions=( ${(M)sessions:#*"(attached)"} )
+ _describe -t sessions 'attached sessions' sessions "$@"
+}
+
function __tmux-socket-name() {
local expl sdir
local curcontext="${curcontext}"
Messages sorted by:
Reverse Date,
Date,
Thread,
Author