repos / zmx

session persistence for terminal processes
git clone https://github.com/neurosnap/zmx.git

commit
81243b9
parent
66d1b8b
author
Yi Zhou
date
2026-04-16 23:58:05 -0400 EDT
Update fish completions for zmx v0.5.0 (#134)
1 files changed,  +18, -7
M src/completions.zig
+18, -7
 1@@ -118,24 +118,35 @@ const zsh_completions =
 2 const fish_completions =
 3     \\complete -c zmx -f
 4     \\
 5+    \\# zmx flags
 6+    \\complete -c zmx -x -n '__fish_is_nth_token 1' -s v -l version -d 'Show version'
 7+    \\complete -c zmx -x -n '__fish_is_nth_token 1' -s h -d 'Show help message'
 8+    \\
 9+    \\# zmx subcommands
10     \\complete -c zmx -n "__fish_is_nth_token 1" -a 'a attach' -d 'Attach to session, creating if needed'
11     \\complete -c zmx -n "__fish_is_nth_token 1" -a 'r run' -d 'Send command without attaching'
12-    \\complete -c zmx -n "__fish_is_nth_token 1" -a 'd detach' -d 'Detach all clients from current session'
13+    \\complete -c zmx -n "__fish_is_nth_token 1" -a 'wr write' -d 'Write stdin to file_path through the session'
14+    \\complete -c zmx -n "__fish_is_nth_token 1" -a 'd detach' -d 'Detach all clients (ctrl+\ for current client)'
15     \\complete -c zmx -n "__fish_is_nth_token 1" -a 'l list' -d 'List active sessions'
16-    \\complete -c zmx -n "__fish_is_nth_token 1" -a 'c completions' -d 'Shell completion scripts'
17-    \\complete -c zmx -n "__fish_is_nth_token 1" -a 'k kill' -d 'Kill a session'
18+    \\complete -c zmx -n "__fish_is_nth_token 1" -a 'k kill' -d 'Kill session and all attached clients'
19     \\complete -c zmx -n "__fish_is_nth_token 1" -a 'hi history' -d 'Output session scrollback'
20-    \\complete -c zmx -n "__fish_is_nth_token 1" -a 'v version' -d 'Show version'
21-    \\complete -c zmx -s v -l version -d 'Show version'
22     \\complete -c zmx -n "__fish_is_nth_token 1" -a 'w wait' -d 'Wait for session tasks to complete'
23+    \\complete -c zmx -n "__fish_is_nth_token 1" -a 't tail' -d 'Follow session output'
24+    \\complete -c zmx -n "__fish_is_nth_token 1" -a 'c completions' -d 'Shell completions (bash, zsh, fish)'
25+    \\complete -c zmx -n "__fish_is_nth_token 1" -a 'v version' -d 'Show version'
26     \\complete -c zmx -n "__fish_is_nth_token 1" -a 'h help' -d 'Show help message'
27-    \\complete -c zmx -s h -d 'Show help message'
28     \\
29-    \\complete -c zmx -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from a attach r run k kill hi history w wait" -a '(zmx list --short 2>/dev/null)' -d 'Session name'
30+    \\# Complete session names and shells
31+    \\complete -c zmx -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from a attach r run wr write hi history" -a '(zmx list --short 2>/dev/null)' -d 'Session name'
32+    \\complete -c zmx -n "not __fish_is_nth_token 1; and __fish_seen_subcommand_from k kill w wait t tail" -a '(zmx list --short 2>/dev/null)' -d 'Session name'
33     \\
34     \\complete -c zmx -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from c completions" -a 'bash zsh fish' -d Shell
35     \\
36+    \\# Subcommand flags
37+    \\complete -c zmx -n "__fish_seen_subcommand_from r run" -s d -d 'Detach from the calling terminal; use `wait` to track its status'
38+    \\complete -c zmx -n "__fish_seen_subcommand_from r run" -l fish -d 'Required when the session runs fish shell'
39     \\complete -c zmx -n "__fish_seen_subcommand_from l list" -l short -d 'Short output'
40+    \\complete -c zmx -n "__fish_seen_subcommand_from k kill" -l force -d 'Force kill'
41     \\complete -c zmx -n "__fish_seen_subcommand_from hi history" -l vt -d 'History format for escape sequences'
42     \\complete -c zmx -n "__fish_seen_subcommand_from hi history" -l html -d 'History format for escape sequences'
43 ;