Commit 81243b9

Yi Zhou  ·  2026-04-16 23:58:05 -0400 EDT
parent 66d1b8b
Update fish completions for zmx v0.5.0 (#134)
1 files changed,  +18, -7
+18, -7
......@@ -118,24 +118,35 @@ const zsh_completions =
118118 const fish_completions =
119119 \\complete -c zmx -f
120120 \\
121+ \\# zmx flags
122+ \\complete -c zmx -x -n '__fish_is_nth_token 1' -s v -l version -d 'Show version'
123+ \\complete -c zmx -x -n '__fish_is_nth_token 1' -s h -d 'Show help message'
124+ \\
125+ \\# zmx subcommands
121126 \\complete -c zmx -n "__fish_is_nth_token 1" -a 'a attach' -d 'Attach to session, creating if needed'
122127 \\complete -c zmx -n "__fish_is_nth_token 1" -a 'r run' -d 'Send command without attaching'
123- \\complete -c zmx -n "__fish_is_nth_token 1" -a 'd detach' -d 'Detach all clients from current session'
128+ \\complete -c zmx -n "__fish_is_nth_token 1" -a 'wr write' -d 'Write stdin to file_path through the session'
129+ \\complete -c zmx -n "__fish_is_nth_token 1" -a 'd detach' -d 'Detach all clients (ctrl+\ for current client)'
124130 \\complete -c zmx -n "__fish_is_nth_token 1" -a 'l list' -d 'List active sessions'
125- \\complete -c zmx -n "__fish_is_nth_token 1" -a 'c completions' -d 'Shell completion scripts'
126- \\complete -c zmx -n "__fish_is_nth_token 1" -a 'k kill' -d 'Kill a session'
131+ \\complete -c zmx -n "__fish_is_nth_token 1" -a 'k kill' -d 'Kill session and all attached clients'
127132 \\complete -c zmx -n "__fish_is_nth_token 1" -a 'hi history' -d 'Output session scrollback'
128- \\complete -c zmx -n "__fish_is_nth_token 1" -a 'v version' -d 'Show version'
129- \\complete -c zmx -s v -l version -d 'Show version'
130133 \\complete -c zmx -n "__fish_is_nth_token 1" -a 'w wait' -d 'Wait for session tasks to complete'
134+ \\complete -c zmx -n "__fish_is_nth_token 1" -a 't tail' -d 'Follow session output'
135+ \\complete -c zmx -n "__fish_is_nth_token 1" -a 'c completions' -d 'Shell completions (bash, zsh, fish)'
136+ \\complete -c zmx -n "__fish_is_nth_token 1" -a 'v version' -d 'Show version'
131137 \\complete -c zmx -n "__fish_is_nth_token 1" -a 'h help' -d 'Show help message'
132- \\complete -c zmx -s h -d 'Show help message'
133138 \\
134- \\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'
139+ \\# Complete session names and shells
140+ \\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'
141+ \\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'
135142 \\
136143 \\complete -c zmx -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from c completions" -a 'bash zsh fish' -d Shell
137144 \\
145+ \\# Subcommand flags
146+ \\complete -c zmx -n "__fish_seen_subcommand_from r run" -s d -d 'Detach from the calling terminal; use `wait` to track its status'
147+ \\complete -c zmx -n "__fish_seen_subcommand_from r run" -l fish -d 'Required when the session runs fish shell'
138148 \\complete -c zmx -n "__fish_seen_subcommand_from l list" -l short -d 'Short output'
149+ \\complete -c zmx -n "__fish_seen_subcommand_from k kill" -l force -d 'Force kill'
139150 \\complete -c zmx -n "__fish_seen_subcommand_from hi history" -l vt -d 'History format for escape sequences'
140151 \\complete -c zmx -n "__fish_seen_subcommand_from hi history" -l html -d 'History format for escape sequences'
141152 ;