Commit fbf900c
Noelle Leigh
·
2026-07-04 10:09:20 -0400 EDT
parent d0eb4cd
fix: Add missing commands to completion scripts - Add print, write, wait, and tail to the scripts in src/completions.zig - Add 'nu' to 'zmx completions' completions (0a5a2a9)
1 files changed,
+24,
-9
+24,
-9
1@@ -32,7 +32,7 @@ const bash_completions =
2 \\ cur="${COMP_WORDS[COMP_CWORD]}"
3 \\ prev="${COMP_WORDS[COMP_CWORD-1]}"
4 \\
5- \\ local commands="attach run send detach list completions kill history version help"
6+ \\ local commands="attach run send print write detach list kill history wait tail completions version help"
7 \\
8 \\ if [[ $COMP_CWORD -eq 1 ]]; then
9 \\ COMPREPLY=($(compgen -W "$commands" -- "$cur"))
10@@ -40,12 +40,12 @@ const bash_completions =
11 \\ fi
12 \\
13 \\ case "$prev" in
14- \\ attach|run|send|kill|history)
15+ \\ attach|run|send|print|write|kill|history|wait|tail)
16 \\ local sessions=$(zmx list --short 2>/dev/null | tr '\n' ' ')
17 \\ COMPREPLY=($(compgen -W "$sessions" -- "$cur"))
18 \\ ;;
19 \\ completions)
20- \\ COMPREPLY=($(compgen -W "bash zsh fish" -- "$cur"))
21+ \\ COMPREPLY=($(compgen -W "bash zsh fish nu" -- "$cur"))
22 \\ ;;
23 \\ list)
24 \\ COMPREPLY=($(compgen -W "--short" -- "$cur"))
25@@ -77,11 +77,15 @@ const zsh_completions =
26 \\ 'attach:Attach to session, creating if needed'
27 \\ 'run:Send command without attaching'
28 \\ 'send:Send raw input to session PTY'
29+ \\ 'print:Inject text into session display'
30+ \\ 'write:Write stdin to file_path through the session'
31 \\ 'detach:Detach all clients from current session'
32 \\ 'list:List active sessions'
33- \\ 'completions:Shell completion scripts'
34 \\ 'kill:Kill a session'
35 \\ 'history:Output session scrollback'
36+ \\ 'wait:Wait for session tasks to complete'
37+ \\ 'tail:Follow session output'
38+ \\ 'completions:Shell completion scripts'
39 \\ 'version:Show version'
40 \\ 'help:Show help message'
41 \\ )
42@@ -89,11 +93,11 @@ const zsh_completions =
43 \\ ;;
44 \\ args)
45 \\ case $words[2] in
46- \\ attach|a|kill|k|run|r|send|s|history|hi)
47+ \\ attach|a|kill|k|run|r|send|s|print|p|write|wr|history|hi|wait|w|tail|t)
48 \\ _zmx_sessions
49 \\ ;;
50 \\ completions|c)
51- \\ _values 'shell' 'bash' 'zsh' 'fish'
52+ \\ _values 'shell' 'bash' 'zsh' 'fish' 'nu'
53 \\ ;;
54 \\ list|l)
55 \\ _values 'options' '--short'
56@@ -131,6 +135,7 @@ const fish_completions =
57 \\complete -c zmx -n "__fish_is_nth_token 1" -a attach -d 'Attach to session, creating if needed'
58 \\complete -c zmx -n "__fish_is_nth_token 1" -a run -d 'Send command without attaching'
59 \\complete -c zmx -n "__fish_is_nth_token 1" -a send -d 'Send raw input to session PTY'
60+ \\complete -c zmx -n "__fish_is_nth_token 1" -a print -d 'Inject text into session display'
61 \\complete -c zmx -n "__fish_is_nth_token 1" -a write -d 'Write stdin to file_path through the session'
62 \\complete -c zmx -n "__fish_is_nth_token 1" -a detach -d 'Detach all clients (ctrl+\ for current client)'
63 \\complete -c zmx -n "__fish_is_nth_token 1" -a list -d 'List active sessions'
64@@ -138,15 +143,15 @@ const fish_completions =
65 \\complete -c zmx -n "__fish_is_nth_token 1" -a history -d 'Output session scrollback'
66 \\complete -c zmx -n "__fish_is_nth_token 1" -a wait -d 'Wait for session tasks to complete'
67 \\complete -c zmx -n "__fish_is_nth_token 1" -a tail -d 'Follow session output'
68- \\complete -c zmx -n "__fish_is_nth_token 1" -a completions -d 'Shell completions (bash, zsh, fish)'
69+ \\complete -c zmx -n "__fish_is_nth_token 1" -a completions -d 'Shell completions (bash, zsh, fish, nu)'
70 \\complete -c zmx -n "__fish_is_nth_token 1" -a version -d 'Show version'
71 \\complete -c zmx -n "__fish_is_nth_token 1" -a help -d 'Show help message'
72 \\
73 \\# Complete session names and shells
74- \\complete -c zmx -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from a attach r run s send wr write hi history" -a '(zmx list --short 2>/dev/null)' -d 'Session name'
75+ \\complete -c zmx -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from a attach r run s send p print wr write hi history" -a '(zmx list --short 2>/dev/null)' -d 'Session name'
76 \\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'
77 \\
78- \\complete -c zmx -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from c completions" -a 'bash zsh fish' -d Shell
79+ \\complete -c zmx -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from c completions" -a 'bash zsh fish nu' -d Shell
80 \\
81 \\# Subcommand flags
82 \\complete -c zmx -n "__fish_seen_subcommand_from r run" -s d -d 'Detach from the calling terminal; use `wait` to track its status'
83@@ -178,6 +183,16 @@ const nu_completions =
84 \\ ...rest: string
85 \\]
86 \\
87+ \\export extern "zmx send" [
88+ \\ name: string@"nu-complete zmx sessions"
89+ \\ text: string
90+ \\]
91+ \\
92+ \\export extern "zmx print" [
93+ \\ name: string@"nu-complete zmx sessions"
94+ \\ text: string
95+ \\]
96+ \\
97 \\export extern "zmx write" [
98 \\ name: string@"nu-complete zmx sessions"
99 \\ path: path