dashboard / bmp/zmx / feat(completions): add nushell #127 rss

open · opened on 2026-05-13T13:57:14Z by bmp
Help
checkout latest patchset:
ssh pr.pico.sh print pr-127 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print ps-X | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 127
add review to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add --review 127
accept PR:
ssh pr.pico.sh pr accept 127
close PR:
ssh pr.pico.sh pr close 127
Timeline Patchsets

Patchset ps-219

feat(completions): add nushell

Benjamin Pollack
2026-05-13T00:37:23Z
Back to top
+44 -0 src/completions.zig link
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
diff --git a/src/completions.zig b/src/completions.zig
index 4789f70..1de7c0a 100644
--- a/src/completions.zig
+++ b/src/completions.zig
@@ -4,11 +4,13 @@ pub const Shell = enum {
     bash,
     zsh,
     fish,
+    nu,
 
     pub fn fromString(s: []const u8) ?Shell {
         if (std.mem.eql(u8, s, "bash")) return .bash;
         if (std.mem.eql(u8, s, "zsh")) return .zsh;
         if (std.mem.eql(u8, s, "fish")) return .fish;
+        if (std.mem.eql(u8, s, "nu")) return .nu;
 
         return null;
     }
@@ -18,6 +20,7 @@ pub const Shell = enum {
             .bash => bash_completions,
             .zsh => zsh_completions,
             .fish => fish_completions,
+            .nu => nu_completions,
         };
     }
 };
@@ -153,3 +156,44 @@ const fish_completions =
     \\complete -c zmx -n "__fish_seen_subcommand_from hi history" -l vt -d 'History format for escape sequences'
     \\complete -c zmx -n "__fish_seen_subcommand_from hi history" -l html -d 'History format for escape sequences'
 ;
+
+const nu_completions =
+    \\def "nu-complete zmx sessions" [] {
+    \\    zmx list --short | lines
+    \\}
+    \\
+    \\def "nu-complete zmx complete" [] {
+    \\    [bash fish nu zsh]
+    \\}
+    \\
+    \\export extern "zmx attach" [
+    \\    name: string@"nu-complete zmx sessions"
+    \\    ...rest: string
+    \\]
+    \\
+    \\export extern "zmx run" [
+    \\    name: string@"nu-complete zmx sessions"
+    \\    -d
+    \\    --fish
+    \\    ...rest: string
+    \\]
+    \\
+    \\export extern "zmx write" [
+    \\    name: string@"nu-complete zmx sessions"
+    \\    path: path
+    \\]
+    \\
+    \\export extern "zmx kill" [
+    \\    --force
+    \\    name: string@"nu-complete zmx sessions"
+    \\]
+    \\
+    \\export extern "zmx detach" []
+    \\export extern "zmx list" [--short]
+    \\export extern "zmx history" [name: string@"nu-complete zmx sessions", --vt, --html]
+    \\export extern "zmx wait" [...sessions: string@"nu-complete zmx sessions"]
+    \\export extern "zmx tail" [...sessions: string@"nu-complete zmx sessions"]
+    \\export extern "zmx version" []
+    \\export extern "completions" [shell: string@"nu-complete zmx complete"]
+    \\export extern "zmx help" []
+;