diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-11 18:30:13 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-12 13:04:32 -0300 |
| commit | b424164922842796619cb6894ec46d729a8a6826 (patch) | |
| tree | bd4653accfaeb67012f4e7257c61eaf4fb12c892 /src/tutor.txt | |
| parent | 08f32cdde672740b71608f3dfccd629dcbac78f7 (diff) | |
| download | pardes-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 'src/tutor.txt')
| -rw-r--r-- | src/tutor.txt | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/src/tutor.txt b/src/tutor.txt index 1d51a4ac..fe80c9e3 100644 --- a/src/tutor.txt +++ b/src/tutor.txt @@ -164,16 +164,25 @@ edit, select and look in. It is not a document, though, and never takes a column of its own: it opens BELOW the pane that asked for it, in that pane's column, be that a file or a shell — and a file you then open from - its rows goes where files go, not under the list. `n`/`N` step the rows - and look each one, so the view follows along. Right-clicking a word that names no file in ANY open - pane's directory searches for it — acme's button 3 — except in tty mode, - where the click belongs to the program on the other end. On a shell with no - search armed, n/N instead step the lookable tokens in its output. + its rows goes where files go, not under the list. `n`/`N` walk those + rows, and walking is ALL they do: a press moves the SELECTION to the + next look-able thing and opens nothing, so you can step past nine hits + to reach the tenth without opening the nine. Enter — the look chord — + opens the one you stopped on. The walk is a RING over PANES and not + over one buffer: the panes you have looked out of come first, most + recent first, then the output buffers you have not, newest first, and + only when there is neither does it step the pane in front of you — so + n/N work on a shell that never had a search armed, and off the end + they come round to the start. `N` is `n` backwards exactly: ten + forward and ten back is where you began. + Right-clicking a word that names no file in ANY open pane's + directory searches for it — acme's button 3 — except in tty mode, + where the click belongs to the program on the other end. A hit in a file reads `path:LINE:COL-ENDCOL`, the ordinary look target carrying the SPAN that matched. A hit in a shell or an output buffer has no file to name, so it reads `@pN:LINE:COL-ENDCOL` — pane N, then the place in - it. Looking either one goes there and SELECTS the span, which is why n/N - land ON a hit rather than beside it. + it. Looking either one goes there and SELECTS the span, which is why an + Enter on a row n/N stepped to lands ON the hit rather than beside it. The range is part of the PATH syntax and not part of search: type one anywhere text lives and a look on it selects. `main.zig:412-418` is whole lines, `main.zig:412:9-21` is columns on one line, `main.zig:412:9-418:1` @@ -182,8 +191,9 @@ FIND: the "Find" builtin (SPC f f) arms the same tag input, but Enter walks the pane's DIRECTORY instead of its text — `fd`, in-core — and writes one matching PATH per row into the same "+Search" buffer. Rows are look - targets like any other, so n/N step them and each found file opens; the - match is on the name, plain and case-insensitive, ".git" is skipped. + targets like any other, so n/N select them one at a time and Enter + opens the one you meant; the match is on the name, plain and + case-insensitive, ".git" is skipped. LAYOUT: columns split the screen; windows stack within a column. Panes abut with no wasted gap — a pane's own trailing edge (its last column, or @@ -519,6 +529,10 @@ SPC k Kill (quit) SPC d Del (close this pane) SPC f s/f f/f n Save / Find / New SPC h t Tutor (this file) SPC c n / c d Newcol / Delcol + SPC y / SPC Y the selection to the SYSTEM clipboard (every + cursor's text joined, or the main cursor's alone) + SPC p / SPC P paste the system clipboard after / before the + selection; SPC R replaces the selection with it SPC t d/c/n/r Debug / Colors / NextColor / Crt toggles SPC t p/l/a Petscii / Palette / Ascii: an image pane's renderer — glyph art instead of pixels, the C64 @@ -530,6 +544,14 @@ SPC j j Last: the pane you were in before this one — what body-normal ESC runs, so it alternates + Those five are helix's own clipboard letters, and the only words that + reach the desktop's clipboard at all: ordinary y d c p P R and the + 1-2 / 1-3 chords all stay in pardes' own register, so deleting a + character can never throw away what you copied from a browser. In a + terminal the copy goes out as OSC 52 and the paste asks for it back + the same way — plenty of terminals refuse that read, so there SPC y + works and SPC p may honestly do nothing. + `?` works at ANY depth: SPC ? lists everything, SPC h ? lists only what the "h" group holds. Help writes into a "+Help" OUTPUT BUFFER, the same kind of pane "/" search results land in — so it opens below @@ -565,9 +587,11 @@ k off the TOPMOST tagline = the top bar, j back down) zt zz zb Ctrl-d/u Ctrl-f Ctrl-w hjkl Alt-n/c Esc = last document <-> last terminal (body normal) + n/N = select the next/prev look-able text, across panes + (a ring); Enter opens what you landed on SPC = the leader: a key path runs a builtin (SPC ? lists them; SPC k Kill, SPC d Del, SPC f s Save, SPC f f Find, - SPC f n New, + SPC f n New, SPC y/Y/p/P/R the system clipboard, SPC w hjkl focus, SPC j j the pane before this one) vs Helix: no multi-cursor; selection is LINE-first (x), plus v chars. |
