From 0919fcef12f973d3129b32f79a331ff8e45cb7ac Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 25 Nov 2026 00:24:12 -0300 Subject: Command: `:` opens a command line in the focused pane's tag, its rows the tag's own words then the commands a helix hand types, each the pardes word it runs (walk UI, pick-ui SPEC.md §8, item 1 of line E2): `:` from a body is a text prompt of its own (Prompt.zig's `.command`, its state Command.zig in TagState.prompt.command), drawn after a `:` key cell in the tag's head, the plain word the line is (`= Exec Save`, `= Exec Theme acme`, `= Look :12`, `= Exec Edit |sort`), the count (`16 commands`, or what a command takes: ``, `⏎ runs it`); its rows in the band: the tag's own words in the tag's order (its text after the prefix but `|`, then `Kill` for a terminal whose tag has none), each `in the tag`, the last underlined as the rule off the rest, then `write w`, `quit q`, `theme`, `set`, `sort`, `reflow`, `goto g`, `open o`, `pipe`, `reload`, `toggle` with what each takes on the right (``, ``, ``, ...), filtered by the field's first word with the query pane's scorer (Names.match) in their own order, the query's bytes in the match tint, eleven around the current one; beside them the current row's doc (a builtin's from the registry, a command's own, naming the word it runs); Tab and S-Tab write the next or the last row into the field, a command with a space after it, the rows staying the line's from before so Tab steps on through them (a click on a row the same, TagState.point); Enter keeps the line in `:`'s history (Pardes.prompt_history.command) and register `:`, puts the tag at rest and runs it as B2 runs a word (exec_cmd, look_cmd): `write [path]` Save, `quit` Del, `theme X` Theme X, `set W v` the setting's word with its value (any case typed), `toggle W` the word bare, `reload` Get, `goto N` Look `:N`, `open F` Look F, `sort`, `reflow [N]` and `pipe cmd` each selection piped as `|` does (`sort`, `fmt -w N`, 80 by default; Pipe.submit, a file's text only), anything else the line Exec'd (a builtin by name, else a command pane); what cannot run is said (`goto: a line number`, `set: no such setting`); `:` on the empty field gives the keyboard to the tag's own text as `:` did before (tagline.enterTag), and `:` there gives it back; `lsp-restart` is not a command: pardes has no word that restarts a language server; Esc in a tag keeps today's meaning (Last): four tests pin it after a click in a tag (tty collapse, tty tagcmd's rename, mouse's double-click, mode's tag Exec); THE TEST SITES that typed `:` from a body to reach the tag now type `::` (44): core/Pipe.zig "| in a tag pipes the tag's own text", test/panes.zig "paste into pane commands and prompts" and "a tag that exactly fills its row", test/behaviour/tags.zig 24 (lines 28 41 53 66 84 93 95 99 108 122 128 137 139 143 156 158 160 162 173 182 194 223 253 440), test/behaviour/keys.zig 41 271 373, test/behaviour/panes.zig 253, test/process/tty_editing.zig 112 1376 1392 2379 2393 2436 2453 2459 2540 2579, tty_terminals.zig 429 453, tty_layout.zig 439; those typing `:` in a tag to come back, or window mode's `:`, are as they were; golden ttytaken: the echoed command two cells to the right (the `:` band takes the terminal's rows for a step and gives them back, so its pty shrinks and grows and bash redraws its line: A's band pushes a terminal's body as any pane's); TEST FIRST: Command.zig ": opens a field in the tag after its key cell ..." and ": on the empty field gives the keyboard to the tag's own text ..." (on the base `:` gives the tag the keyboard: no prompt); core-test 1021/1188 (167 skipped), pane-test 182/184, behaviour-test 274/277 (the failures A's, as on E's tip), shell-test 1235/1238, process-test the base's five (find, builtins, leader, tagnav, ttyhelp) and none of mine Co-Authored-By: Claude Opus 5.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/process/tty_editing.zig | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'test/process/tty_editing.zig') diff --git a/test/process/tty_editing.zig b/test/process/tty_editing.zig index 53e1da1e..e6af5562 100644 --- a/test/process/tty_editing.zig +++ b/test/process/tty_editing.zig @@ -109,7 +109,7 @@ fn fileedit(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.snap("undone"); // Save through the file pane's own tag: `:` focuses that same tag and `w` // selects Save before the ordinary execute key runs it. - try t.key(":"); + try t.key(": :"); try t.stable(400, 5000); try t.key("w tab"); try t.stable(600, 8000); @@ -1373,7 +1373,7 @@ fn cmdword(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // opens ITS tag; `A` appends at the end of it, Esc and `h` put the // normal-mode cursor on the last character typed, and the execute key runs // the word under it exactly as the body's does. - try t.key(":"); + try t.key(": :"); try t.key("A"); try t.key("space"); try t.send("Exec"); @@ -1389,7 +1389,7 @@ fn cmdword(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.snap("execword"); // a command word run from that tag runs as a command pane in the directory // the pane lists, as a word run from any text pane's tag does - try t.key(":"); + try t.key(": :"); try t.key("A"); try t.key("space"); try t.send("@`echo ZZ''T`"); @@ -2376,7 +2376,7 @@ fn tagcmd(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); try t.snap("edited"); // `:` -> the tag, in normal mode, cursor on Save - try t.key(":"); + try t.key(": :"); try t.stable(400, 5000); try t.snap("colon"); // w -> the "Save" span (selected, like the body's word motion) @@ -2390,7 +2390,7 @@ fn tagcmd(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.snap("saved"); try t.snapFile("written", "/tmp/pardes-snap/tagcmd/cwd/c.txt"); // `:` then `:`: back to the body with the tag untouched, nothing run - try t.key(":"); + try t.key(": :"); try t.stable(400, 5000); try t.key(":"); try t.stable(400, 5000); @@ -2433,7 +2433,7 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); try t.snap("start"); // `:` -> the file's OWN tagline, normal mode, on Save - try t.key(":"); + try t.key(": :"); try t.stable(400, 5000); try t.snap("colon"); // w selects in the tag the way it selects in a body @@ -2450,13 +2450,13 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); try t.snap("right"); // `:` there -> that pane's own tag, on its Save the first time - try t.key(":"); + try t.key(": :"); try t.stable(400, 5000); try t.snap("right-tag"); // back left, and `:` finds the file's tag cursor where l left it try t.key("c-w h enter"); try t.stable(400, 5000); - try t.key(":"); + try t.key(": :"); try t.stable(400, 5000); try t.snap("left-tag"); // `:` in the tag's normal mode: back to the body @@ -2537,7 +2537,7 @@ fn tagpath(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.wait(8000, "c.txt"); try t.stable(700, 20000); try t.snap("start"); - try t.key(":"); + try t.key(": :"); try t.stable(400, 5000); try t.snap("colon"); try t.key("0"); @@ -2576,7 +2576,7 @@ fn tagpath(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("esc"); try t.stable(400, 5000); try t.snap("name-cancelled"); - try t.key(":"); + try t.key(": :"); try t.key("0"); try t.key("i"); try t.send("/renamed"); -- cgit v1.3