Commit 129875f

RadosÅ‚aw Stachowiak  ·  2026-04-26 17:17:54 -0400 EDT
parent 50db1df
feat: accept ls as list alias to help our muscle memory
4 files changed,  +10, -3
+1, -0
......@@ -8,6 +8,7 @@ Use spec: https://common-changelog.org/
88
99 - `zmx send` send raw bytes to session without ZMX completion marker or auto-newline
1010 - `zmx print` send raw bytes to client's stdout
11+- `zmx ls` is accepted as an alias for `zmx list`
1112
1213 ### Fixed
1314
+1, -1
......@@ -83,7 +83,7 @@ Commands:
8383 [p]rint <name> <text...> Inject text into session display
8484 [wr]ite <name> <file_path> Write stdin to file_path through the session
8585 [d]etach Detach all clients (ctrl+\\ for current client)
86- [l]ist [--short] List active sessions
86+ [l]ist|ls [--short] List active sessions
8787 [k]ill <name>... [--force] Kill session and all attached clients
8888 [hi]story <name> [--vt|--html] Output session scrollback
8989 [w]ait <name>... Wait for session tasks to complete
+2, -2
......@@ -99,7 +99,7 @@ pub fn main() !void {
9999 return printVersion(&cfg);
100100 } else if (std.mem.eql(u8, cmd, "help") or std.mem.eql(u8, cmd, "h") or std.mem.eql(u8, cmd, "-h")) {
101101 return help();
102- } else if (std.mem.eql(u8, cmd, "list") or std.mem.eql(u8, cmd, "l")) {
102+ } else if (std.mem.eql(u8, cmd, "list") or std.mem.eql(u8, cmd, "l") or std.mem.eql(u8, cmd, "ls")) {
103103 const short = if (args.next()) |arg| std.mem.eql(u8, arg, "--short") else false;
104104 return list(&cfg, short);
105105 } else if (std.mem.eql(u8, cmd, "completions") or std.mem.eql(u8, cmd, "c")) {
......@@ -1234,7 +1234,7 @@ fn help() !void {
12341234 \\ [p]rint <name> <text...> Inject text into session display
12351235 \\ [wr]ite <name> <file_path> Write stdin to file_path through the session
12361236 \\ [d]etach Detach all clients (ctrl+\\ for current client)
1237- \\ [l]ist [--short] List active sessions
1237+ \\ [l]ist|ls [--short] List active sessions
12381238 \\ [k]ill <name>... [--force] Kill session and all attached clients
12391239 \\ [hi]story <name> [--vt|--html] Output session scrollback
12401240 \\ [w]ait <name>... Wait for session tasks to complete
+6, -0
......@@ -100,6 +100,12 @@ load test_helper
100100 [[ "$output" == *"no sessions found"* ]]
101101 }
102102
103+@test "ls aliases list" {
104+ run "$ZMX" ls
105+ [ "$status" -eq 0 ]
106+ [[ "$output" == *"no sessions found"* ]]
107+}
108+
103109 @test "list: shows session details" {
104110 "$ZMX" run test-list -d echo hello
105111 wait_for_session test-list