summaryrefslogtreecommitdiff
path: root/test/snapshots/psearch.snap
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-11 18:30:13 -0300
committerGabriel Schneider <[email protected]>2026-08-12 13:04:32 -0300
commitb424164922842796619cb6894ec46d729a8a6826 (patch)
treebd4653accfaeb67012f4e7257c61eaf4fb12c892 /test/snapshots/psearch.snap
parent08f32cdde672740b71608f3dfccd629dcbac78f7 (diff)
downloadpardes-b424164922842796619cb6894ec46d729a8a6826.tar.gz
pardes-b424164922842796619cb6894ec46d729a8a6826.zip
clipboard, n/N and the tty prompt: three things that were half-wired
Three changes that all turned out to be the same shape -- a feature that worked in one direction, or for one pane kind, and quietly did not in the others. CLIPBOARD. Every register write emitted set_clipboard, so deleting one character threw away whatever the desktop was holding; multi-cursor yank took the join's early return and emitted nothing at all, so the same key reached the clipboard on one cursor and not on two. Nothing could READ the clipboard: the SDL shell had no SDL_GetClipboardText anywhere in it, and the tty shell never asked for OSC 52, so `p` from another application was dead in both. Now it is helix's split. y/d/c/p/P/R and the acme chords are the DEFAULT REGISTER and nothing else; the system clipboard is five words on helix's own letters -- SPC y, SPC Y, SPC p, SPC P, SPC R -- spelled as builtins so they land in Help and are executable like every other verb. The one exception is the tag `y` chord, which still mirrors out because a tag is always insert, so SPC cannot be pressed there, and copying the path out is the whole point of the chord. Reading is a new read_clipboard effect answered by an ordinary Event.paste, so the round trip is honest about being one: SDL and NSPasteboard answer inside the same drain, the browser answers a promise, and a terminal answers over OSC 52 or -- far more often -- refuses. A refused read is a paste that does not happen, and the request dies at the next keystroke rather than landing minutes late in whatever pane is focused by then. The tty shell also enables BRACKETED PASTE now and coalesces paste_start..paste_end into one event. Before this a paste arrived as a flood of individual key presses: plausible in insert mode, and in normal mode every pasted character ran as a command. n/N. They stepped the armed results buffer and immediately Looked each row, so you could not walk past a hit without opening it. They are a MOTION now: select the next look-able text, open nothing, and let Enter decide. What they step is the largest whitespace-delimited run look.resolve can act on (look.lookableSpan, wrapper punctuation peeled), over a RING of panes -- every pane that has performed a look, most recent first, then the output buffers that have not, newest first, and only if both are empty the pane in front of you. N is the exact inverse of n, computed rather than remembered: both directions ask the same question about the same spans and compare against the column the walk parks on, so x presses one way and x back land exactly where you started, pane boundaries and the ring's seam included. A ring rather than a list with two ends because a shell's cursor sits at the prompt, below everything it has printed, so a walk that could not come round would have nowhere to go on the very first press -- which is the case n/N were written for. One motion everywhere, no pane-kind or buffer-kind special case. The only thing a buffer may change is the GRAIN of what a step selects, and it does it with one flag rather than a branch: output_pane.Traits.commands (renamed from `executes`, which named one reader's behaviour rather than the fact) makes a row select WHOLE, because a ThemeSel line is a word to run and has no path inside it to pick out. `]d`/`[d` are not n/N -- they are helix's diagnostic motions, their job is to ARRIVE, and they still reach searchStep. THE TTY PROMPT. Leaving raw tty blanked the prompt row, and the command you had typed at that prompt shares the row, so it went too -- a shell out of tty read as output only. OSC 133 marks the row CELL by cell, so the two are separable: config.tty_blank = .prompt cuts the prompt's own columns and leaves the command, left-hugged at column 0 in line with the output under it rather than in a bay of blanks. .prompt_and_input is the old behaviour, kept. Because the row is now something you can put a cursor in, enterTty adds the hidden prompt width back before asking ghostty to walk the shell's own cursor to it -- the modal column on a cut row is short by exactly that much. Verified: unit-test 186/186 (nine new), snap 87/87 (new ttyprompt.snap), hxdiff 481 and hxparity 561 with 0 mismatches, tty and gui both build. And against the real binaries rather than the harness: in a pty, SPC y emits OSC 52 carrying exactly the selection while plain y emits nothing, SPC p issues the read and pastes the reply, and a bracketed paste of "dd..." inserts text instead of deleting two lines. In a real SDL window, SPC y then SPC p round trips through the system clipboard while the default register holds different text. Setting tty_blank back to .prompt_and_input reproduces all 86 old goldens byte for byte.
Diffstat (limited to 'test/snapshots/psearch.snap')
-rw-r--r--test/snapshots/psearch.snap29
1 files changed, 21 insertions, 8 deletions
diff --git a/test/snapshots/psearch.snap b/test/snapshots/psearch.snap
index 11316ea9..1b9eac61 100644
--- a/test/snapshots/psearch.snap
+++ b/test/snapshots/psearch.snap
@@ -2,9 +2,10 @@
# the shell's own scrollback (the plain text view Look reads, prompt rows
# hidden). Results land in a +Search OUTPUT BUFFER — a file pane with no file
# behind it, so its tag has no Save — and point at `@p0:LINE:COL-ENDCOL`, the
-# look target that names a live pane, since a terminal has no path. n/N walk
-# the buffer and look each row, scrolling the terminal to that line of its
-# scrollback and selecting the span the row names.
+# look target that names a live pane, since a terminal has no path. n/N SELECT
+# the next/prev row in the buffer and open nothing; Enter — the look chord —
+# is what scrolls the terminal to that line of its scrollback and selects the
+# span the row names.
# PLACEMENT, and this script is the proof: an output buffer is NOT a document
# — it is the result list of the pane that asked for it — so even here, with no
# doc pane in the session for it to join, it does NOT take a column of its own.
@@ -35,21 +36,27 @@ key enter
wait 10000 @p0:2:3
stable 700 15000
snap results
-# n looks result 1: the terminal's cursor lands on that scrollback line, on
-# the matched SPAN (cols 3..6, past the leading "x ") — not the start of the
-# line, and selected rather than merely parked on
+# n selects result 1 and Enter looks it: the terminal's cursor lands on that
+# scrollback line, on the matched SPAN (cols 3..6, past the leading "x ") —
+# not the start of the line, and selected rather than merely parked on
key n
+key enter
stable 700 15000
snap first
snapstyle first
key n
+key enter
stable 700 15000
snap second
-# N walks back
+# N walks back one row, Enter looks it
key N
+key enter
stable 700 15000
snap back
-# a no-match search opens an empty buffer of its own; n has nowhere to go
+# a no-match search opens an empty buffer of its own — and n does not stop
+# there. The walk is a RING across panes, not one buffer's rows, so with
+# nothing look-able in the empty list it carries on into the one that does
+# have rows and resumes it a row past where the N above left off.
key /
text zzqq
key enter
@@ -62,6 +69,12 @@ snap nomatch
# so the buffer stays empty. Col 5 row 4 is the `M` of the first `x MARK a`,
# in the shell's body in both modes (normal hides the prompt row, leaving it
# blank, so the output rows sit at the same place either way).
+# The left click first is the price of the step above: it left the cursor in
+# the results buffer, and c-b is read by the ACTIVE pane — there is no tty
+# behind a +Search to toggle.
+press left 5 4
+release left 5 4
+stable 400 5000
key c-b
stable 600 8000
press right 5 4