zmx
created pr with
129.1
changed status to
accepted
cmds
checkout latest patchset:
ssh pr.pico.sh print 129 | git am -3checkout any patchset in a patch request:
ssh pr.pico.sh print 129.[rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 129set PR to open (enables RSS notifications):
ssh pr.pico.sh pr open 129set PR to draft (stops RSS notifications):
ssh pr.pico.sh pr draft 129
Patchset
129.1
fix: Add missing commands to completion scripts
Noelle Leigh
2026-07-04T14:09:20Z- Add print, write, wait, and tail to the scripts in src/completions.zig - Add 'nu' to 'zmx completions' completions (0a5a2a9)
Semantic diff summary
0 added,
7 modified,
0 signature changed,
0 removed
across 1 analyzed file
+24
-9
src/completions.zig
#
| ... | ... | @@ -32,7 +32,7 @@ const bash_completions = | |
| 32 | 32 | \\ cur="${COMP_WORDS[COMP_CWORD]}" | |
| 33 | 33 | \\ prev="${COMP_WORDS[COMP_CWORD-1]}" | |
| 34 | 34 | \\ | |
| 35 | - | \\ local commands="attach run send detach list completions kill history version help" | |
| 35 | + | \\ local commands="attach run send print write detach list kill history wait tail completions version help" | |
| 36 | 36 | \\ | |
| 37 | 37 | \\ if [[ $COMP_CWORD -eq 1 ]]; then | |
| 38 | 38 | \\ COMPREPLY=($(compgen -W "$commands" -- "$cur")) |
| ... | ... | @@ -40,12 +40,12 @@ const bash_completions = | |
| 40 | 40 | \\ fi | |
| 41 | 41 | \\ | |
| 42 | 42 | \\ case "$prev" in | |
| 43 | - | \\ attach|run|send|kill|history) | |
| 43 | + | \\ attach|run|send|print|write|kill|history|wait|tail) | |
| 44 | 44 | \\ local sessions=$(zmx list --short 2>/dev/null | tr '\n' ' ') | |
| 45 | 45 | \\ COMPREPLY=($(compgen -W "$sessions" -- "$cur")) | |
| 46 | 46 | \\ ;; | |
| 47 | 47 | \\ completions) | |
| 48 | - | \\ COMPREPLY=($(compgen -W "bash zsh fish" -- "$cur")) | |
| 48 | + | \\ COMPREPLY=($(compgen -W "bash zsh fish nu" -- "$cur")) | |
| 49 | 49 | \\ ;; | |
| 50 | 50 | \\ list) | |
| 51 | 51 | \\ COMPREPLY=($(compgen -W "--short" -- "$cur")) |
| ... | ... | @@ -77,11 +77,15 @@ const zsh_completions = | |
| 77 | 77 | \\ 'attach:Attach to session, creating if needed' | |
| 78 | 78 | \\ 'run:Send command without attaching' | |
| 79 | 79 | \\ 'send:Send raw input to session PTY' | |
| 80 | + | \\ 'print:Inject text into session display' | |
| 81 | + | \\ 'write:Write stdin to file_path through the session' | |
| 80 | 82 | \\ 'detach:Detach all clients from current session' | |
| 81 | 83 | \\ 'list:List active sessions' | |
| 82 | - | \\ 'completions:Shell completion scripts' | |
| 83 | 84 | \\ 'kill:Kill a session' | |
| 84 | 85 | \\ 'history:Output session scrollback' | |
| 86 | + | \\ 'wait:Wait for session tasks to complete' | |
| 87 | + | \\ 'tail:Follow session output' | |
| 88 | + | \\ 'completions:Shell completion scripts' | |
| 85 | 89 | \\ 'version:Show version' | |
| 86 | 90 | \\ 'help:Show help message' | |
| 87 | 91 | \\ ) |
| ... | ... | @@ -89,11 +93,11 @@ const zsh_completions = | |
| 89 | 93 | \\ ;; | |
| 90 | 94 | \\ args) | |
| 91 | 95 | \\ case $words[2] in | |
| 92 | - | \\ attach|a|kill|k|run|r|send|s|history|hi) | |
| 96 | + | \\ attach|a|kill|k|run|r|send|s|print|p|write|wr|history|hi|wait|w|tail|t) | |
| 93 | 97 | \\ _zmx_sessions | |
| 94 | 98 | \\ ;; | |
| 95 | 99 | \\ completions|c) | |
| 96 | - | \\ _values 'shell' 'bash' 'zsh' 'fish' | |
| 100 | + | \\ _values 'shell' 'bash' 'zsh' 'fish' 'nu' | |
| 97 | 101 | \\ ;; | |
| 98 | 102 | \\ list|l) | |
| 99 | 103 | \\ _values 'options' '--short' |
| ... | ... | @@ -131,6 +135,7 @@ const fish_completions = | |
| 131 | 135 | \\complete -c zmx -n "__fish_is_nth_token 1" -a attach -d 'Attach to session, creating if needed' | |
| 132 | 136 | \\complete -c zmx -n "__fish_is_nth_token 1" -a run -d 'Send command without attaching' | |
| 133 | 137 | \\complete -c zmx -n "__fish_is_nth_token 1" -a send -d 'Send raw input to session PTY' | |
| 138 | + | \\complete -c zmx -n "__fish_is_nth_token 1" -a print -d 'Inject text into session display' | |
| 134 | 139 | \\complete -c zmx -n "__fish_is_nth_token 1" -a write -d 'Write stdin to file_path through the session' | |
| 135 | 140 | \\complete -c zmx -n "__fish_is_nth_token 1" -a detach -d 'Detach all clients (ctrl+\ for current client)' | |
| 136 | 141 | \\complete -c zmx -n "__fish_is_nth_token 1" -a list -d 'List active sessions' |
| ... | ... | @@ -138,15 +143,15 @@ const fish_completions = | |
| 138 | 143 | \\complete -c zmx -n "__fish_is_nth_token 1" -a history -d 'Output session scrollback' | |
| 139 | 144 | \\complete -c zmx -n "__fish_is_nth_token 1" -a wait -d 'Wait for session tasks to complete' | |
| 140 | 145 | \\complete -c zmx -n "__fish_is_nth_token 1" -a tail -d 'Follow session output' | |
| 141 | - | \\complete -c zmx -n "__fish_is_nth_token 1" -a completions -d 'Shell completions (bash, zsh, fish)' | |
| 146 | + | \\complete -c zmx -n "__fish_is_nth_token 1" -a completions -d 'Shell completions (bash, zsh, fish, nu)' | |
| 142 | 147 | \\complete -c zmx -n "__fish_is_nth_token 1" -a version -d 'Show version' | |
| 143 | 148 | \\complete -c zmx -n "__fish_is_nth_token 1" -a help -d 'Show help message' | |
| 144 | 149 | \\ | |
| 145 | 150 | \\# Complete session names and shells | |
| 146 | - | \\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' | |
| 151 | + | \\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' | |
| 147 | 152 | \\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' | |
| 148 | 153 | \\ | |
| 149 | - | \\complete -c zmx -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from c completions" -a 'bash zsh fish' -d Shell | |
| 154 | + | \\complete -c zmx -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from c completions" -a 'bash zsh fish nu' -d Shell | |
| 150 | 155 | \\ | |
| 151 | 156 | \\# Subcommand flags | |
| 152 | 157 | \\complete -c zmx -n "__fish_seen_subcommand_from r run" -s d -d 'Detach from the calling terminal; use `wait` to track its status' |
| ... | ... | @@ -178,6 +183,16 @@ const nu_completions = | |
| 178 | 183 | \\ ...rest: string | |
| 179 | 184 | \\] | |
| 180 | 185 | \\ | |
| 186 | + | \\export extern "zmx send" [ | |
| 187 | + | \\ name: string@"nu-complete zmx sessions" | |
| 188 | + | \\ text: string | |
| 189 | + | \\] | |
| 190 | + | \\ | |
| 191 | + | \\export extern "zmx print" [ | |
| 192 | + | \\ name: string@"nu-complete zmx sessions" | |
| 193 | + | \\ text: string | |
| 194 | + | \\] | |
| 195 | + | \\ | |
| 181 | 196 | \\export extern "zmx write" [ | |
| 182 | 197 | \\ name: string@"nu-complete zmx sessions" | |
| 183 | 198 | \\ path: path |