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/ | |
| 8 | 8 | ||
| 9 | 9 | - `zmx send` send raw bytes to session without ZMX completion marker or auto-newline | |
| 10 | 10 | - `zmx print` send raw bytes to client's stdout | |
| 11 | + | - `zmx ls` is accepted as an alias for `zmx list` | |
| 11 | 12 | ||
| 12 | 13 | ### Fixed | |
| 13 | 14 |
+1,
-1
| ... | ... | @@ -83,7 +83,7 @@ Commands: | |
| 83 | 83 | [p]rint <name> <text...> Inject text into session display | |
| 84 | 84 | [wr]ite <name> <file_path> Write stdin to file_path through the session | |
| 85 | 85 | [d]etach Detach all clients (ctrl+\\ for current client) | |
| 86 | - | [l]ist [--short] List active sessions | |
| 86 | + | [l]ist|ls [--short] List active sessions | |
| 87 | 87 | [k]ill <name>... [--force] Kill session and all attached clients | |
| 88 | 88 | [hi]story <name> [--vt|--html] Output session scrollback | |
| 89 | 89 | [w]ait <name>... Wait for session tasks to complete |
+2,
-2
| ... | ... | @@ -99,7 +99,7 @@ pub fn main() !void { | |
| 99 | 99 | return printVersion(&cfg); | |
| 100 | 100 | } else if (std.mem.eql(u8, cmd, "help") or std.mem.eql(u8, cmd, "h") or std.mem.eql(u8, cmd, "-h")) { | |
| 101 | 101 | 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")) { | |
| 103 | 103 | const short = if (args.next()) |arg| std.mem.eql(u8, arg, "--short") else false; | |
| 104 | 104 | return list(&cfg, short); | |
| 105 | 105 | } else if (std.mem.eql(u8, cmd, "completions") or std.mem.eql(u8, cmd, "c")) { |
| ... | ... | @@ -1234,7 +1234,7 @@ fn help() !void { | |
| 1234 | 1234 | \\ [p]rint <name> <text...> Inject text into session display | |
| 1235 | 1235 | \\ [wr]ite <name> <file_path> Write stdin to file_path through the session | |
| 1236 | 1236 | \\ [d]etach Detach all clients (ctrl+\\ for current client) | |
| 1237 | - | \\ [l]ist [--short] List active sessions | |
| 1237 | + | \\ [l]ist|ls [--short] List active sessions | |
| 1238 | 1238 | \\ [k]ill <name>... [--force] Kill session and all attached clients | |
| 1239 | 1239 | \\ [hi]story <name> [--vt|--html] Output session scrollback | |
| 1240 | 1240 | \\ [w]ait <name>... Wait for session tasks to complete |
+6,
-0
| ... | ... | @@ -100,6 +100,12 @@ load test_helper | |
| 100 | 100 | [[ "$output" == *"no sessions found"* ]] | |
| 101 | 101 | } | |
| 102 | 102 | ||
| 103 | + | @test "ls aliases list" { | |
| 104 | + | run "$ZMX" ls | |
| 105 | + | [ "$status" -eq 0 ] | |
| 106 | + | [[ "$output" == *"no sessions found"* ]] | |
| 107 | + | } | |
| 108 | + | ||
| 103 | 109 | @test "list: shows session details" { | |
| 104 | 110 | "$ZMX" run test-list -d echo hello | |
| 105 | 111 | wait_for_session test-list |