repos / zmx

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

commit
f062076
parent
3e5f982
author
Josh Bainbridge
date
2026-01-01 19:22:36 -0500 EST
docs: add documentation for evaluating auto-complete

After adding support for auto-completion, we could add instructions for
users on how to integrate this into their shell configurations.

Update the README with a new sections for shell auto-complete
configuration.
3 files changed,  +37, -2
M README.md
+34, -1
 1@@ -58,7 +58,7 @@ Commands:
 2   [r]un <name> [command...]      Send command without attaching, creating session if needed
 3   [d]etach                       Detach all clients from current session  (ctrl+\ for current client)
 4   [l]ist [--short]               List active sessions
 5-  [c]ompletions <shell>          Completion scripts for shell integration
 6+  [c]ompletions <shell>          Completion scripts for shell integration (bash, zsh, or fish)
 7   [k]ill <name>                  Kill a session and all attached clients
 8   [hi]story <name> [--vt|--html] Output session scrollback (--vt or --html for escape sequences)
 9   [v]ersion                      Show version information
10@@ -137,6 +137,39 @@ POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=my_zmx_session
11    style = 'plain'
12 ```
13 
14+## shell completion
15+
16+Shell auto-completion for `zmx` commands and session names can be enabled using the `completions` subcommand. Once configured, you'll get auto-complete for both local `zmx` commands and sessions:
17+
18+```bash
19+ssh remote-server zmx attach session-na<TAB>
20+# <- auto-complete suggestions appear here
21+```
22+
23+### zsh
24+
25+Add this to your `.zshrc` file:
26+
27+```zsh
28+eval "$(zmx completions zsh)"
29+```
30+
31+### bash
32+
33+Add this to your `.bashrc` file:
34+
35+```bash
36+eval "$(zmx completions bash)"
37+````
38+
39+### fish
40+
41+Add this to your `.config/fish/config.fish` file:
42+
43+```fish
44+zmx completions fish | source
45+````
46+
47 ## philosophy
48 
49 The entire argument for `zmx` instead of something like `tmux` that has windows, panes, splits, etc. is that job should be handled by your os window manager. By using something like `tmux` you now have redundant functionality in your dev stack: a window manager for your os and a window manager for your terminal. Further, in order to use modern terminal features, your terminal emulator **and** `tmux` need to have support for them. This holds back the terminal enthusiast community and feature development.
M src/completions.zig
+2, -0
1@@ -47,6 +47,8 @@ const bash_completions =
2     \\    list)
3     \\      COMPREPLY=($(compgen -W "--short" -- "$cur"))
4     \\      ;;
5+    \\    *)
6+    \\      ;;
7     \\  esac
8     \\}
9     \\
M src/main.zig
+1, -1
1@@ -476,7 +476,7 @@ fn help() !void {
2         \\  [r]un <name> [command...]     Send command without attaching, creating session if needed
3         \\  [d]etach                      Detach all clients from current session (ctrl+\ for current client)
4         \\  [l]ist [--short]              List active sessions
5-        \\  [c]ompletions <shell>         Completion scripts for shell integration
6+        \\  [c]ompletions <shell>         Completion scripts for shell integration (bash, zsh, or fish)
7         \\  [k]ill <name>                 Kill a session and all attached clients
8         \\  [hi]story <name> [--vt|--html] Output session scrollback (--vt or --html for escape sequences)
9         \\  [v]ersion                     Show version information