From 13d234f431a98bf97fcc1caec812f59eff711aa0 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 26 Nov 2026 00:03:50 -0300 Subject: tagline, edit, dump, layout: a pane tag reads its path, then its computed words, the words that act now, read-only and made again from its state as the path is, then the user's text (UX DESIGN K'1, K'3, binding; the user: "pardes looked so cramped and full of information with the taglines compared to the other editors", "I liked C and D"); THE OLD WAY: a tag's words were its own text (`tag.own`, or until edited its kind's default `*_tail`: `Save Term Collapse Follow Del`, a speaking file's `Def Refs`, `TreeContext`, `LocationsConfig`, a terminal's `Term Save Mode Filter Collapse Del`), the same in every state, so a file tag held 5 to 9 command words, wrapped to a second row at 84 columns, and `Save` stood there clean; THE CHANGE: tagline.computedWords per K'3's table (a file reading `Keep Del`, `Keep` its walk's word after the path as before; held `Del`, `Undo` while its journal has a step back with something in it (insert mode's `i` alone marks a step of none: a behaviour test caught `Undo` coming, and a 24-column tag wrapping, before a key was typed), `Redo` while it has one forward; unsaved, gone from disk too, `Save Undo Del`; `Diff` first for a diff, a +Pager holding one and the Diff view; `Filter` for a +Pager; a +New never `Save` (the table's `Del; Undo once typed into`); a directory `Get Del`; a command pane `Kill Del` running, `Del` done; queries and the preview unchanged; a kind its own words then `Del` (Kind.reopen, `Term` and `Collapse` gone); a terminal `Del`, its shell's word after it as its text, `Term` until the shell says its name, then `Term+fish`, as before), a comptime table of the 32 file combinations, no allocation; restPrefix = path, computed words and a blank, the prefix every edit must leave as it is (edit.setEditTextSpan, which compared the path alone) and the 9P cleartag's caret goes after; `tag.own` holds only what the user typed (curTail: own, else a terminal's shell word, else none), shown after the computed words and never regenerated; enterTag puts the caret at the start of the user's text, no longer on `Save`; a question waiting at rest (TagState.asks, the test TagState.asking used) replaces the computed words with the own text, as out of rest (D13, D1 unchanged: prefixIn gives the path alone, sync keeps the tag's offsets at rest); `:` lists the computed words, then the own text's, `in the tag`; Follow's `Unfollow` goes in the new page's own text with no second blank; RESTORE: dump.dropOldTags drops an own text equal to its kind's tag before K' (tagline.kindTail, the old defaults kept for it) where a Restore, a start from a dump and an Upgrade load (loadAndRevive; a replica's join loads its authority's, dropped there; a Restore replays through the same path), any other kept whole as the user's text; THE LAYOUT (two faults the lean tags let the random placements find, ninep/tree.zig "random placements ... leave no pane under its tag and two rows"): (1) seed 273 (core-test): `Edit =` gave a full column's +Errors an undo step, `Undo` wrapped its 16-cell tag onto a 5th row, the pane under its minimum, no row to give: layout.minRows now counts a tag with the widest computed words its pane can come to show (tagline.widestWords: `Save Undo Redo` where it saves, a query's frozen words; a reading pane's own, its first edit holds it), so an edit never takes a row its placement did not leave; (2) seed 162 and 192 (shell-test): a walk step in a 12-cell tag whose basename did not fit beside its newest step (`test.txt:1 › …f.txt Keep Del`), the fold had nothing left to cut: tagline.folded then folds that step into the `+N` too (D2's basename stays whole; a hunk in the fold W4 touches); TESTS (FIRST): tagline.zig "a pane tag's computed words are the words that act now, its own text after them (UX K'1, K'3)" (reading, held, typed twice, undone, saved, a .patch, a pager, a pager's diff, a +New before and after typing, a kind), "typing in a tag goes after its computed words, and stays the user's text through a change of state" (`Mine` typed after `Del`, a Backspace on the blank before it refused, the body typed into: `Save Undo Del Mine`, the caret still on `M`), "a dump of a build before UX K' restores a tag's old default own text as none, any other as the user's"; TESTS CHANGED, each for a word gone from a tag: lsp/Ask.zig Def/Refs (the 2-1 chord now on `Def Refs` typed into the tag's own text, kindTail asserts the kind's words), Effect.zig "Save is a word of every pane with text behind it and no other" (kindTail, computedWords `Del` while clean), Core.zig TreeContext (kindTail, the tag holds no TreeContext), Filter (computedWords `Filter Del`), pane-tag Exec (`Term+sh` the text; `Theme dark` and the fallback word found where they are), compact tag commands (`Del Term`), Term+ paths (`Term+/bin/sh`, `Term+sh`), the command pane's and REPL's prefixes (pathPrefix), Dir (`Get Del`), Stream (`More Del`), jj At (pathPrefix), Pipe (`| tr` on the own text `Look here`), Command.zig `:` (typed into first: `Save Undo Del` its tag's rows, 14 commands), Trail.zig (W4's file: tags `/test.txt Del `, `rank.zig Del `; the Fixture 120 to 200 columns, as its 85-cell tmp paths beside a short tag folded the walks these tests read; "too short to halve" 24 to 20 rows), TagState and Band (a tag of two rows: own text given), Messages (the question test at 200 columns, the tag at rest one row), dev/tui/tui.zig (a terminal view's wrapped tag read on across its rows: the shorter prefix cut `w19`), test/mode.zig (`Mode` typed into the terminal tag's own text, kindTail has it), test/panes.zig (an image's pathPrefix); BEHAVIOUR (a helper's edits, each a word moved): tags.zig (a tag's keyboard starts on its own text, so `Save Term`, `Save`, `JumpTrail` are written into the own text where a test clicked or edited them; expected tags `/test.txt Del ...`), keys.zig (a scratch's Save prompt by `SPC f s`, was `::` Tab), modes.zig, mouse.zig (`Keep Del`, the own text swept), panes.zig ("an unsaved file's tag ... Save and Undo come into its words", Collapse by `C-w c`), placement.zig, terminals.zig (`Del Term`), addons_pdf.zig (`PdfSections PdfTint PdfFit Del`), columns_and_tags.zig; addons/fake/fake.out and addons/life/life.out re-recorded (a tag one row shorter: one more body row); PROCESS (a helper's edits): 11 cases clicked a word gone or a row a shorter tag moved (lookpanes, selarg, tagnav, tag, images, collapse, layout-open, ghostty-mid, look-fd-deep, respawn, ttylook: each to the word's new place, the own text or the row it moved to) and 5 more whose clicks had silently stopped doing what their comments say (shrinktag, windowops, ttyedit, tagcmd, chordcut); GOLDENS: 101 re-recorded, every change one of: a tag's words (`Term+bash Save Mode Filter Collapse Del` to `Del Term+bash`), a tag no longer wrapping (its body a row taller, the rows under it up one, one more line at the foot), splits a row smaller where a tag above stopped wrapping, a click at a fixed row landing a body row lower, the computed words' ink in style rows; three now do what their comments say where the old golden recorded a miss (chordcut's end, jumps' look-row, wrap's logical-j); ttyhelp.golden left as the merge's placeholder (M1's; this change moves it too); core-test 1126/1299 (173 skipped: +3), shell-test 1347/1350 (3 skipped), pane-test 183/184 (1 skipped), behaviour-test 280/280 and --replay 20 seeds of 70 steps 0 failures, process-test 1 of 147 failed (ttyhelp, the placeholder; 3 skipped), term-test 17/17, kitty-test 45/45, the gui unit-test 1949/1954 (4 skipped; its one failure colors.zig's whole-ring CPU timing at a load of 8.7, L1's, passing in core-test, and the known BaselineHarnessMismatch); the soak `replicas -- --clients 5 --rtt 30,80,207`: diverged 0, unequal 0, agree/differ 451/0 420/0 623/0, unlisted stops 0, the corpus 22 of 22 scenes the same, no leak; no dump field changes (no fuzz); no frame/perf gate (moved to the programme's end); load 2.6 to 10.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE --- test/process/tty_editing.zig | 196 +++++++++++++++++++++-------------------- test/process/tty_images.zig | 11 +-- test/process/tty_layout.zig | 30 ++++--- test/process/tty_terminals.zig | 22 ++--- 4 files changed, 136 insertions(+), 123 deletions(-) (limited to 'test/process') diff --git a/test/process/tty_editing.zig b/test/process/tty_editing.zig index a5d58906..bdd84dc5 100644 --- a/test/process/tty_editing.zig +++ b/test/process/tty_editing.zig @@ -392,42 +392,42 @@ fn chordcut(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(700, 15000); try t.snap("opened"); // 1-2 Cut: left-drag over "line" on line 2, tap middle while holding - try t.press("left", "8", 10); - try t.drag("left", "11", 10); - try t.press("middle", "11", 10); - try t.release("middle", "11", 10); - try t.release("left", "11", 10); + try t.press("left", "8", 8); + try t.drag("left", "11", 8); + try t.press("middle", "11", 8); + try t.release("middle", "11", 8); + try t.release("left", "11", 8); try t.stable(400, 5000); try t.snap("cut"); // 1-2 then 1-3 in one hold = copy: line 3 keeps its text, register loaded - try t.press("left", "8", 11); - try t.drag("left", "11", 11); - try t.press("middle", "11", 11); - try t.release("middle", "11", 11); - try t.press("right", "11", 11); - try t.release("right", "11", 11); - try t.release("left", "11", 11); + try t.press("left", "8", 9); + try t.drag("left", "11", 9); + try t.press("middle", "11", 9); + try t.release("middle", "11", 9); + try t.press("right", "11", 9); + try t.release("right", "11", 9); + try t.release("left", "11", 9); try t.stable(400, 5000); try t.snap("copied"); // 1-3 at a bare click point: hold left past the end of line 4, tap right — // the register splices in at the click - try t.press("left", "14", 12); - try t.press("right", "14", 12); - try t.release("right", "14", 12); - try t.release("left", "14", 12); + try t.press("left", "14", 10); + try t.press("right", "14", 10); + try t.release("right", "14", 10); + try t.release("left", "14", 10); try t.stable(400, 5000); try t.snap("pointpaste"); // 1-3 over a fresh selection replaces it with the register - try t.press("left", "9", 13); - try t.drag("left", "11", 13); - try t.press("right", "11", 13); - try t.release("right", "11", 13); - try t.release("left", "11", 13); + try t.press("left", "9", 11); + try t.drag("left", "11", 11); + try t.press("right", "11", 11); + try t.release("right", "11", 11); + try t.release("left", "11", 11); try t.stable(400, 5000); try t.snap("replaced"); // arm the cancel tests: append `echo B''OO g.txt` to line 2 - try t.press("left", "10", 10); - try t.release("left", "10", 10); + try t.press("left", "10", 8); + try t.release("left", "10", 8); try t.stable(400, 5000); try t.key("i"); try t.send("echo B''OO g.txt"); @@ -436,56 +436,56 @@ fn chordcut(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); // 2-3 cancel (acme textselect2): tap right during the middle execute-drag // over `echo B''OO` — the command never runs (no BOO anywhere) - try t.press("middle", "10", 10); - try t.drag("middle", "19", 10); - try t.press("right", "19", 10); - try t.release("right", "19", 10); - try t.release("middle", "19", 10); + try t.press("middle", "10", 8); + try t.drag("middle", "19", 8); + try t.press("right", "19", 8); + try t.release("right", "19", 8); + try t.release("middle", "19", 8); try t.stable(700, 8000); try t.snap("cancelexec"); // the same drag released clean proves the word was live: BOO appears - try t.press("middle", "10", 10); - try t.drag("middle", "19", 10); - try t.release("middle", "19", 10); + try t.press("middle", "10", 8); + try t.drag("middle", "19", 8); + try t.release("middle", "19", 8); try t.wait(10000, "BOO"); try t.stable(700, 10000); try t.snap("execafter"); // 3-1 cancel (acme textselect3): tap left during the right look-drag over // g.txt — no pane opens - try t.press("right", "21", 10); - try t.drag("right", "25", 10); - try t.press("left", "25", 10); - try t.release("left", "25", 10); - try t.release("right", "25", 10); + try t.press("right", "21", 8); + try t.drag("right", "25", 8); + try t.press("left", "25", 8); + try t.release("left", "25", 8); + try t.release("right", "25", 8); try t.stable(700, 8000); try t.snap("cancellook"); // the same look released clean opens g.txt - try t.press("right", "21", 10); - try t.drag("right", "25", 10); - try t.release("right", "25", 10); + try t.press("right", "21", 8); + try t.drag("right", "25", 8); + try t.release("right", "25", 8); try t.wait(10000, "line 2"); try t.stable(700, 10000); try t.snap("lookafter"); // a fresh left click dismisses the chord's leftover selection instead of // dragging the anchored span to the click: copy `line` on g.txt line 1 // (styled snap shows the selection), then click the next row (it's gone) - try t.press("left", "8", 24); - try t.drag("left", "11", 24); - try t.press("middle", "11", 24); - try t.release("middle", "11", 24); - try t.press("right", "11", 24); - try t.release("right", "11", 24); - try t.release("left", "11", 24); + try t.press("left", "8", 23); + try t.drag("left", "11", 23); + try t.press("middle", "11", 23); + try t.release("middle", "11", 23); + try t.press("right", "11", 23); + try t.release("right", "11", 23); + try t.release("left", "11", 23); try t.stable(400, 5000); try t.style("chordsel"); - try t.press("left", "8", 25); - try t.release("left", "8", 25); + try t.press("left", "8", 24); + try t.release("left", "8", 24); try t.stable(400, 5000); try t.style("clickdismiss"); // g.txt opened under the lower shell's text and left it three rows: close it, // and the shell grows back into its rows, for what follows to run in - try t.press("middle", "59", 23); - try t.release("middle", "59", 23); + try t.press("middle", "@Del", 22); + try t.release("middle", "@Del", 22); try t.stable(700, 15000); // tty paste chord: over a mouse-listening app B1 is the app's, so the // chord's B1 holds Shift (B3 is pardes's either way); the app gets a click @@ -554,31 +554,31 @@ fn selarg(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-b"); try t.stable(600, 8000); // keep a left selection over ZZARG in pane A (this also focuses A) - try t.press("left", "3", 5); - try t.drag("left", "7", 5); - try t.release("left", "7", 5); + try t.press("left", "3", 4); + try t.drag("left", "7", 4); + try t.release("left", "7", 4); try t.stable(400, 5000); try t.snap("kept"); // chord in pane B: middle on ./c.sh + left tap (B has NO selection: the // argument comes from pane A's kept left selection) + middle release runs - try t.press("middle", "55", 5); - try t.press("left", "55", 5); - try t.release("middle", "55", 5); - try t.release("left", "55", 5); + try t.press("middle", "55", 4); + try t.press("left", "55", 4); + try t.release("middle", "55", 4); + try t.release("left", "55", 4); try t.wait(10000, "CHORDARG:ZZARG"); try t.stable(700, 10000); try t.snap("crosspane"); // now an explicit modal selection: plain-click ZZVEE in A (drops A's kept // left selection), select it with v e, chord in B again - try t.press("left", "9", 5); - try t.release("left", "9", 5); + try t.press("left", "9", 4); + try t.release("left", "9", 4); try t.stable(400, 5000); try t.send("ve"); try t.stable(400, 5000); - try t.press("middle", "55", 5); - try t.press("left", "55", 5); - try t.release("middle", "55", 5); - try t.release("left", "55", 5); + try t.press("middle", "55", 4); + try t.press("left", "55", 4); + try t.release("middle", "55", 4); + try t.release("left", "55", 4); try t.wait(10000, "CHORDARG:ZZVEE"); try t.stable(700, 10000); try t.snap("vselarg"); @@ -1061,14 +1061,14 @@ fn lookpanes(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); // an ordinary dir look on the shell's own ls output: alpha's directory pane, // split below it, which takes the keyboard - try t.press("right", "@alpha", 6); - try t.release("right", "@alpha", 6); + try t.press("right", "@alpha", 5); + try t.release("right", "@alpha", 5); try t.wait(10000, "amark.txt"); try t.stable(700, 20000); // type the words to look into what is left of the workdir shell (past its own // ls output, on the same row: its last row is the resize handle) - try t.press("left", "95", 5); - try t.release("left", "95", 5); + try t.press("left", "95", 4); + try t.release("left", "95", 4); try t.stable(400, 5000); try t.key("i"); try t.send("zqonly.txt pick.txt twin.txt"); @@ -1077,42 +1077,42 @@ fn lookpanes(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); try t.snap("shells"); // make the beta pane the most recently focused, so the walk has to pass it - try t.press("left", "10", 5); - try t.release("left", "10", 5); + try t.press("left", "10", 4); + try t.release("left", "10", 4); try t.stable(700, 10000); // zqonly.txt is only under alpha: the clicked shell's cwd fails, beta fails, // alpha's directory pane answers. Before, this word became a search. - try t.press("right", "@zqonly.txt", 5); - try t.release("right", "@zqonly.txt", 5); + try t.press("right", "@zqonly.txt", 4); + try t.release("right", "@zqonly.txt", 4); try t.wait(10000, "ONLY-IN-ALPHA"); try t.stable(700, 20000); try t.snap("other-dir"); // both.txt is in BOTH dirs and alpha is now the most recent (its file pane // just opened), but the CLICK still wins: looked inside the beta pane it // opens beta's copy - try t.press("right", "10", 5); - try t.release("right", "10", 5); + try t.press("right", "10", 4); + try t.release("right", "10", 4); try t.wait(10000, "BOTH-FROM-BETA"); try t.stable(700, 20000); try t.snap("clicked-wins"); // from a pane whose own dir holds neither copy the access order decides: // focus alpha's directory pane (a click on its first row), look pick.txt (in // both dirs) from the workdir shell -> alpha's - try t.press("left", "@amark.txt", 9); - try t.release("left", "@amark.txt", 9); + try t.press("left", "@amark.txt", 8); + try t.release("left", "@amark.txt", 8); try t.stable(700, 10000); - try t.press("right", "@pick.txt", 5); - try t.release("right", "@pick.txt", 5); + try t.press("right", "@pick.txt", 4); + try t.release("right", "@pick.txt", 4); try t.wait(10000, "PICK-FROM-ALPHA"); try t.stable(700, 20000); try t.snap("mru-alpha"); // focus the beta pane instead and the same look flips: twin.txt is in both // dirs, beta is most recent, beta's copy opens - try t.press("left", "10", 5); - try t.release("left", "10", 5); + try t.press("left", "10", 4); + try t.release("left", "10", 4); try t.stable(700, 10000); - try t.press("right", "@twin.txt", 5); - try t.release("right", "@twin.txt", 5); + try t.press("right", "@twin.txt", 4); + try t.release("right", "@twin.txt", 4); try t.wait(10000, "TWIN-FROM-BETA"); try t.stable(700, 20000); try t.snap("mru-beta"); @@ -2390,8 +2390,10 @@ fn follow(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // `:` — vim's command line with acme's vocabulary. It focuses the pane's OWN // tag in NORMAL mode (block cursor; the layout box shows the pane's BODY mode, // which for this file pane is normal either way). The tag remembers where its -// cursor was; the first time there is nothing to remember and it starts on -// Save. The tag's normal mode is the body's: w selects the "Save" span exactly +// cursor was; the first time there is nothing to remember and it starts at +// the start of the tag's own text, after the computed words (`Save Undo Del` +// on this edited file). The tag's normal mode is the body's: b steps back +// over the words onto Save, w selects the "Save" span exactly // as a body word motion does, and the execute key runs the word under the // cursor and hands the body back — same keys as the body, so Tab by default // (see config.look_key/exec_key). `:` again backs out instead, leaving the tag @@ -2411,10 +2413,12 @@ fn tagcmd(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.settle(100); try t.stable(400, 5000); try t.snap("edited"); - // `:` -> the tag, in normal mode, cursor on Save + // `:` -> the tag, in normal mode, cursor at its own text try t.key(": :"); try t.stable(400, 5000); try t.snap("colon"); + // b three times: back over Del and Undo onto Save; `;` keeps the cursor alone + try t.key("b b b ;"); // w -> the "Save" span (selected, like the body's word motion) try t.key("w"); try t.stable(400, 5000); @@ -2439,7 +2443,7 @@ fn tagcmd(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // there are no tag-only hops. `:` is the one key a tag and a body do not // share: from the body it focuses the pane's own tag, from the tag it hands the // keyboard back to the body. Each tag remembers its cursor; the first time -// there is nothing to remember and it starts on Save. +// there is nothing to remember and it starts at the start of the tag's own text. // // Evidence is the `cursor=` header (the ACTIVE pane's cursor, which while a tag // is focused sits on THAT pane's tag row) plus each pane's layout box, which @@ -2472,12 +2476,13 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("space w k enter"); try t.stable(400, 5000); try t.snap("start"); - // `:` -> the file's OWN tagline, normal mode, on Save + // `:` -> the file's OWN tagline, normal mode, at its own text try t.key(": :"); try t.stable(400, 5000); try t.snap("colon"); - // w selects in the tag the way it selects in a body - try t.key("w"); + // w selects in the tag the way it selects in a body: from the tag's start + // (`0`; the cursor starts after the computed words, here the tag's end) + try t.key("0 w"); try t.stable(400, 5000); try t.snap("word"); // l is a motion in the tag, not a hop to the next pane @@ -2489,7 +2494,7 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-w l enter"); try t.stable(400, 5000); try t.snap("right"); - // `:` there -> that pane's own tag, on its Save the first time + // `:` there -> that pane's own tag, at its own text the first time try t.key(": :"); try t.stable(400, 5000); try t.snap("right-tag"); @@ -2511,8 +2516,8 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-b"); try t.stable(700, 15000); try t.snap("tty-on"); - try t.press("left", "@Mode", 3); - try t.release("left", "@Mode", 3); + try t.press("left", "@Term+bash", 3); + try t.release("left", "@Term+bash", 3); try t.stable(400, 5000); try t.snap("tty-tag"); try t.key(":"); @@ -2638,13 +2643,12 @@ fn tag(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(31, 150, &.{ "-n", "3" }); try t.wait(8000, "t.txt"); try t.stable(700, 20000); - // Click the one editable separator before Save, directly after the cwd. - // The former generated alignment gap no longer exists. - // The layout box shows + // Click just past the end of the tag's own text (Term+bash, after the + // computed words). The layout box shows // the pane's BODY mode, not the tag's; `i` then types into the tag where it // was clicked. - try t.press("left", "@Save-1", 3); - try t.release("left", "@Save-1", 3); + try t.press("left", "@Term+bash+9", 3); + try t.release("left", "@Term+bash+9", 3); try t.stable(400, 5000); try t.snap("tag-focus"); try t.key("i"); diff --git a/test/process/tty_images.zig b/test/process/tty_images.zig index 9c37a40d..bb9da072 100644 --- a/test/process/tty_images.zig +++ b/test/process/tty_images.zig @@ -8,7 +8,7 @@ pub const cases = .{ // image panes: right-click a .ppm opens petscii glyph art (no kitty in the // harness). The tag starts with the renderer's plain state fields followed by -// its path and `Term Del`; the fields are display-only, while their toggles are +// its path and `Del`; the fields are display-only, while their toggles are // builtins under SPC t (the old clickable tag words sat past the pane's right // edge, so clicking them only ever hit the neighbouring shell's tag). fn images(gpa: std.mem.Allocator, exe: [:0]const u8) !void { @@ -53,12 +53,13 @@ fn images(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // prefix is wider than this source-local column, so widen the grid for this // final assertion. (A column grip drag intentionally takes width from only // one neighbour, which cannot expose this 82-column prefix.) Then click the - // visible tail itself, at its `Term`. This proves the image tag is an ordinary - // editor rather than accidentally typing at a clipped read-only path. + // visible tail itself, past its `Del`, where its own text starts. This proves + // the image tag is an ordinary editor rather than accidentally typing at a + // clipped read-only path. try t.resize(31, 400); try t.stable(400, 5000); - try t.press("left", "@Term", 7); - try t.release("left", "@Term", 7); + try t.press("left", "@Del+4", 7); + try t.release("left", "@Del+4", 7); try t.stable(400, 5000); try t.key("i"); try t.send("Zork "); diff --git a/test/process/tty_layout.zig b/test/process/tty_layout.zig index 00197a5c..76bed736 100644 --- a/test/process/tty_layout.zig +++ b/test/process/tty_layout.zig @@ -56,7 +56,9 @@ fn colgrip(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.done(); } -// A default pane-tag command collapses to one row and restores the body. +// A pane-tag command collapses to one row and restores the body. Collapse +// and Save are no computed words of a clean file's tag (UX K'1), so they are +// typed into the tag's own text first, where a click runs them as before. // Exercise real middle clicks twice, then the tag's own execute key twice: a // click types into the tag, Esc is its normal mode, and Tab executes there. fn collapse(gpa: std.mem.Allocator, exe: [:0]const u8) !void { @@ -66,6 +68,12 @@ fn collapse(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(25, 160, &.{"kept.txt"}); try t.wait(8000, "KEEP-THIRD"); try t.stable(500, 15000); + try t.key(": : i"); + try t.send("Collapse Save"); + try t.key("esc"); + try t.settle(100); + try t.key(":"); + try t.stable(400, 5000); try t.snap("before"); try t.press("middle", "@Collapse", 3); try t.release("middle", "@Collapse", 3); @@ -335,9 +343,9 @@ fn layout_open(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // execute the file's command (middle drag over line 1): it runs as a command // pane for sub/, forked at the bottom of the rightmost column, splitting only // the pane above it - try t.press("middle", "8", 25); - try t.drag("middle", "19", 25); - try t.release("middle", "19", 25); + try t.press("middle", "8", 23); + try t.drag("middle", "19", 23); + try t.release("middle", "19", 23); try t.wait(10000, "TTYOK"); try t.motion("40", 27); try t.stable(700, 10000); @@ -369,7 +377,7 @@ fn shrinktag(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); try t.snap("before"); // drag the lower pane's grip up under pane 0's tag row: it keeps 2 body rows - try t.press("left", "1", 18); + try t.press("left", "1", 17); try t.drag("left", "1", 3); try t.release("left", "1", 3); try t.motion("40", 25); @@ -386,15 +394,15 @@ fn shrinktag(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); // re-enlarge: the lower pane's grip, now under pane 0's 2 body rows, pulled // back down - try t.press("left", "1", 7); - try t.drag("left", "1", 18); - try t.release("left", "1", 18); + try t.press("left", "1", 6); + try t.drag("left", "1", 17); + try t.release("left", "1", 17); try t.motion("40", 25); try t.stable(500, 8000); try t.snap("restored"); // the bottom pane stops at ITS tag and 2 rows too: its grip dragged past the // bottom - try t.press("left", "1", 18); + try t.press("left", "1", 17); try t.drag("left", "1", 31); try t.release("left", "1", 31); try t.motion("40", 25); @@ -578,9 +586,9 @@ fn windowops(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.motion("20", 16); try t.stable(400, 5000); try t.snap("hover-h"); - // resize the left pair by the lower pane's grip, 4 rows up (a terminal has no + // resize the left pair by the lower pane's grip, 3 rows up (a terminal has no // rule between panes; pane 0's last row is now 13) - try t.press("left", "1", 18); + try t.press("left", "1", 17); try t.drag("left", "1", 14); try t.release("left", "1", 14); try t.stable(500, 8000); diff --git a/test/process/tty_terminals.zig b/test/process/tty_terminals.zig index a49d3696..86eab7b7 100644 --- a/test/process/tty_terminals.zig +++ b/test/process/tty_terminals.zig @@ -125,8 +125,8 @@ fn ttyedit(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-b"); try t.stable(600, 8000); // click into the middle of the first output row - try t.press("left", "8", 9); - try t.release("left", "8", 9); + try t.press("left", "8", 8); + try t.release("left", "8", 8); try t.stable(400, 5000); try t.snap("before"); // Enter splits the row there: "one t" stays, "wo three" becomes a real line @@ -303,8 +303,8 @@ fn ttylook(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // selection: the cursor word expands): the click puts it on the ls command // line's `ls`, a word no file names, which a terminal lists in a +Search, // its row the place in that terminal (@p1:1:1-2) - try t.press("left", "4", 5); - try t.release("left", "4", 5); + try t.press("left", "4", 4); + try t.release("left", "4", 4); try t.stable(400, 5000); try t.key("enter"); try t.wait(10000, "@p1:1:1-2"); @@ -597,8 +597,8 @@ fn respawn(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(700, 20000); // middle-click Del on the lower-left pane's tag: the pane id is freed while // its shell process stays alive in the slot - try t.press("middle", "@Collapse+9", 18); - try t.release("middle", "@Collapse+9", 18); + try t.press("middle", "@Del", 18); + try t.release("middle", "@Del", 18); try t.stable(700, 10000); // Alt-n reuses the freed id -> spawn effect lands on the occupied slot try t.key("a-n"); @@ -707,7 +707,7 @@ fn look_fd_deep(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.send("cd a && ls && fd"); try t.key("enter"); try t.wait(8000, "c.txt"); - try t.wait(8000, "cwd/a Term"); + try t.wait(8000, "cwd/a Del Term"); try t.stable(700, 20000); try t.snap("listed"); try t.press("right", "6", 8); @@ -752,10 +752,10 @@ fn ghostty_mid(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-b"); try t.stable(600, 8000); try t.send("\x1b[I"); - try t.send("\x1b[<35;10;10M\x1b[<35;7;8M\x1b[<35;4;6M"); - try t.send("\x1b[<1;4;6M"); - try t.send("\x1b[<1;4;6m"); - try t.send("\x1b[<35;6;6M"); + try t.send("\x1b[<35;10;9M\x1b[<35;7;7M\x1b[<35;4;5M"); + try t.send("\x1b[<1;4;5M"); + try t.send("\x1b[<1;4;5m"); + try t.send("\x1b[<35;6;5M"); try t.wait(10000, "GHOSTOK"); try t.stable(700, 10000); try t.snap("ghostty-mid"); -- cgit v1.3