summaryrefslogtreecommitdiff
path: root/src/terminal.zig
Commit message (Collapse)AuthorAge
* dump: a closed terminal brought back on a screen-state replica gets its ↵Gabriel Schneider2026-10-30
| | | | | | emulator on the C heap, as terminal.create makes one (terminal.emulatorGpa): loadPane named no `.terminal` allocator, so its emulator was the rollback epoch's, and its screen replica's blobs, made with State.gpa, were freed with the C heap's behind the epoch at a client's end and again by it (H21: `double free or corruption` in Epoch.deinit at a hangup, `free(): invalid pointer` at a rejoin), and a rollback freed what a delta under a held copy made of them Co-Authored-By: Claude Opus 5.5 <[email protected]>
* terminal: a pane without an emulator (a file's, a picker's, a preview's) ↵Gabriel Schneider2026-10-30
| | | | | | torn down in a replica's speculation does not stop it: deinitEmulator asked the authority before it looked for an emulator, so the input after any close (its reap) waited a round trip (the finder's typing, 4 of 6 stops) Co-Authored-By: Claude Opus 5.5 <[email protected]>
* replica: pardes's own steps over a terminal speculated, not every input ↵Gabriel Schneider2026-10-30
| | | | | | while one has the keyboard (H14): what reaches its program is a pty write and stops as before; its view (normal-mode keys, the wheel, Ctrl-u) moves here at once, the rollback copy keeping each terminal's view (it holds no emulator) and a delta setting it, put back between the units it replays in the order the deltas came among them; what was applied over a terminal applied again over each delta or rows that come while it waits, and its unit taken at once rather than kept to replay over later deltas; closing a terminal stops (its pty's end is the authority's) Co-Authored-By: Claude Opus 5.5 <[email protected]>
* replica: what stopped each input's speculation is counted by name ↵Gabriel Schneider2026-10-30
| | | | | | (PARDES_REPLICA_STATS's `stops`: a host function's, a site's, or a poison's reason, which tape.poison now takes; PARDES_REPLICA_TRACE says it with the input); a window client's PARDES_TEST_LATENCY says each input (`I seq ns at-once`) and, after each unit, the first of its own not confirmed (`U ns seq`), so a harness finds the frame that shows an input that waited Co-Authored-By: Claude Opus 5.5 <[email protected]>
* terminal: an authority with screen-state replicas sizes a terminal after the ↵Gabriel Schneider2026-10-30
| | | | | | step's unit, not inside it (resize_to, made by Peers.unit, null from `create` on): a client typing at another size than the last typist read history rows its replay held as holes, and the rows the session sent for them came in the new grid's numbering, which the replica cannot take, so its replay read blank text (the soak's local80 cell: jumps, njumps, jcur, pane 1.body at a b; fixer 2's H18, pane N.ovl); test/replicas.zig sizes them after its fill too; an in-process test reads the history in the step that resizes, with the session's order of flush, fill and unit, and another makes a terminal from 0xAA memory and finds no size waiting Co-Authored-By: Claude Opus 5.5 <[email protected]>
* terminal: a step that reads a terminal's rows as the core keeps them marks ↵Gabriel Schneider2026-10-30
| | | | | | | | | | it read too: `fill` sent a client that came since (its history all holes) none of the rows the step read shellRows set `read` only when it built the rows, not when it handed out the ones kept since the last write, so after a client joined (or was started afresh) a step reading through the cache left the client's holes unsent, and it replayed the step on blanks. Found on the way to H18, whose fix is fixer 1's (wwkwwlzt). Test (failing before): a step that reads a terminal's rows as the core keeps them sends a new client the ones it holds as holes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* web: the build links no libc, so what is the C heap's is a hosted build's ↵Gabriel Schneider2026-10-30
| | | | | | alone: terminal.create takes emulator_gpa (std.heap.c_allocator) only in a hosted build, as only one has a screen-state replica, and walk's blob lists (a replica client's, a join's) only with libc; `zig build web` failed on main at terminal.zig:601, and at walk.zig:115 behind it; it builds, and test/web-snapshots/touch.mjs passes (the driver's own CDP-deadline test fails as on main, untouched) Co-Authored-By: Claude Opus 5.5 <[email protected]>
* tape: an error crosses by its name, a stat as fs.OsStat, and the tape's ↵Gabriel Schneider2026-10-30
| | | | | | shape is in wire.semantics: a replica of another build read its session's units as its own build's, so a window client of a terminal's session, or of the box's, read every error by a number its build gives another (451 of 505 names numbered otherwise in the Linux terminal's and window's builds, 244 between Linux and FreeBSD: pardes-gui replaying a terminal's tape panicked at `unexpected error code, found error.NonLocalPath`, and so did main's window client of a session on the box at its Look of a fifo) and a FreeBSD stat out of step (nlink 8 bytes there, 4 here); a name this build's set lacks is a divergence (error.NoSuchError), never another error; an anyerror (a host's report) reads back as one of tape.Failure's, a Debug build panicking at one outside it as it is taped; tape.shape (each taped type's fields, tags, enum names and numbers) in semantics refuses, in words, builds whose tapes differ (the stat taped as before: the Linux and FreeBSD builds hash to two), and a site whose result tape.results does not list is a compile error; walk's test of an error by its name Co-Authored-By: Claude Opus 5.5 <[email protected]>
* terminal: a shell's cells painted from the row's own pin (cellAt), not ↵Gabriel Schneider2026-10-30
| | | | | | getCell's walk from the viewport's top to the row for every cell: a frame of a 120x40 terminal over 64 KB to 8 MB of scrollback 107-127 -> 94-102 us against base, ReleaseFast; the 'regression' phase 5B read against base was a Debug-core perf binary (core_optimize debug, terminal safe) beside a ReleaseFast one, file gestures level once both are ReleaseFast Co-Authored-By: Claude Opus 5.5 <[email protected]>
* a replica client's join costs the session's step its mutable state alone: ↵Gabriel Schneider2026-10-30
| | | | | | | | | | the dump leaves the blobs out (walk.zig `Dump.deferred`: a `.blob`'s texts of 4 KiB and up, noted where they go) and its terminals' emulators (a size: the first delta brings each), the client's writer thread writes the welcome and the dump with the blobs put back in place, and each blob is pinned until written (memory.zig `pin`: its free put off); the texts the session never digested are hashed first on a thread of their own (walk.zig `unhashed`, `makeWords`), the join waiting a boundary for them The client is unchanged: what it reads is the dump `dumpBytes` makes, byte for byte (a test splices one and compares). ReleaseFast, the session's worst boundary while three clients join one after another (`t2/join2.py`), before and after: typical (4.1 MB of files, 1 MB of scrollback, an 8.1 MB dump) 12.4 to 1.6 ms; big (38.6 MB, 8 MB, 76 MB) 51.3 to 1.5 ms; a 100 MB file open beside typical's (254 MB) 172.5 to 1.6 ms. Of the dump the step makes 113 to 122 KB. PARDES_REPLICA_STATS says each join's time and the state's size. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* remote client: predicted echo (src/echo.zig) over its own view, judged a ↵Gabriel Schneider2026-10-30
| | | | | | | | | frame at a time and woken while predictions are out; PARDES_NO_ECHO turns it off; a session's step that reads whether a terminal is at its prompt after its output (the first prompt's greeting, a command waiting for the prompt) is taped (`.prompt`), as a screen replica's emulator is the last delta's until the next Found by a client opening a shell of its own (` nt`): the session's layout after the shell's first output saw the prompt and typed its greeting (`ls`, after a pty resize), and the client's replay of it, its emulator a delta behind, did not: it diverged at once. At 207 ms through the relay (Debug): a key into a shell on the client's screen p50 9.1 ms with prediction, 213.6 ms without. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* echo: a replica draws a key typed into a terminal at once, mosh's way (a ↵Gabriel Schneider2026-10-30
| | | | | | printable character at the cursor, Backspace, Left and Right, in tty mode on the primary screen), from an overlay of its own that no digest, dump or rollback copy sees, painted over the terminal's body at the end of renderBody (the tty's and the GUI's); judged at each delta once the authority has the key and 50 ms have passed, every prediction taken back on a mismatch; drawn at once at a prompt pardes's marks vouch for, elsewhere only once an echo was confirmed, never after a drawn misprediction until one is, so a password prompt or a program that ignores input shows nothing typed; the keys typed behind one not predicted (Tab, Enter) predicted over the screen that shows its doing; zig build replicas -- --echo types a corpus into a played shell at 30/80/207 ms: a key to its character p50 239 -> 8.9 ms and p90 248 -> 15.8 ms at 207, no wrong character drawn; docs/next-daemon.md: the decisions, the hook for the remote client, the numbers, the gates and what is not done Co-Authored-By: Claude Opus 5.5 <[email protected]>
* screen-state replicas: a replica's emulators on the C heap, outside its ↵Gabriel Schneider2026-10-29
| | | | | | | | | | rollback epoch, so a delta written under a held copy is no copy's to keep or put back (a ReleaseFast run found the heap corrupted) terminal.zig: State.gpa, what an emulator and its State are allocated with: the core's, but on a screen-state replica the C heap (emulator_gpa). replica.zig applies deltas and rows with it; the epoch's pause is gone (rollback.zig back to part A's but for the rows cache). The harness in ReleaseFast corrupted the heap after 20 seeds: a safe build's check named an allocation the copy saved and a delta freed while the epoch was paused, reached as `Text.own` through a view's stale slot (views.zig keeps the live view's parked share as stale copies, and the copy walks it), the replica's old terminal's pin map at that address. With the emulator outside the epoch, nothing of it is saved, kept or put back, and every free under a held copy is put off again, as in part A. Debug, 20 seeds at 80 ms and the defaults: no divergence, every replica and terminal the authority's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* screen-state replicas: what a terminal's ingest tells the positions pardes ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | keeps over it taped, the history a step reads sent before its unit, rows sent a blob once a message, and the rows cache out of the rollback copy terminal.zig, tape.zig: ingestWithPositions tracks its rows only where an ingest happens; what the ingest told them (each tracked row's row after it and whether it was erased, a clear, whether the pages lived, a pin not made) is a taped value (Site.positions), which a screen-state replica, ingesting nothing, takes; the logic after it runs alike on both. On the stack, so the local path allocates nothing new. buildRows marks a terminal read (State.read) outside the render (terminal.drawing). screen_state.zig, replica.zig: the authority keeps each peer's holes as its replica does (Peer.holes, from the deltas it sent), and Screens.fill sends a peer the rows it lacks of every terminal a step read, after the step and before its unit, so a replay reads what the step read (a text-mode cursor moved into history the flood scrolled past diverged). encodeRows sends each distinct blob once a message and the rows as addresses (a fill after yes is a third). The rows cache is dropped when a copy is taken and emptied when it is put back, not saved. test/replicas.zig: Ctrl-b in the mix (a shell out of tty mode: text, cursors and selections over it), and a shell's session (prompts, titles, directories, clears) between the TUI and the flood. 4 seeds x 120 inputs x 3 clients at 30, 80, 207 ms: no divergence, every replica and terminal the authority's, 4,653 deltas checked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* phase 5 part B, terminals: a replica's terminal fed by screen-state deltas, ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | | | several in flight against the version last sent, its history the authority's to the row, and the authority's own steps batched into a unit a frame screen_state.zig: each state the authority sends is a version of its terminal (Track), made once for every peer; a peer's delta is against the version it was last sent (the stream is ordered and loses nothing), up to 32 in flight, a peer at the bound waiting for an acknowledgement and then getting the newest; peers at one base are sent the same bytes. A replica refuses a delta against another base and is started afresh. It keeps the authority's history extent to the row (no byte limit of its own, trimmed to the authority's count), takes its viewport and its cursor's semantic content, and grows a flood's rows in bulk. The soak now keeps several in flight, lands them late in order, loses one now and then, and checks the history extent and the viewport too. replica.zig: Screens (the authority's tracks and peers) and Replica.screen/screenRequest, messages of u8 pane, u32 serial, u8 kind (a delta, rows; an ack, a row request, a reset). Deltas are applied with the replica's epoch paused, so an emulator outlives a rollback. Authority.output/pending: its own steps (a pty's output) go into one unit, sent before any other input it steps and at a frame, with one digest; under screen state a digest is one word. tape.zig, terminal.zig: under screen state an output is recorded without its bytes, pty writes are off the tape on both sides, no digest covers an emulator, and a replica's core never ingests or resizes one (a resize's own core work, the pointer selections cleared, still runs). A terminal counts its writes (State.changes); its MarkedHandler cycle rides in each delta. test/replicas.zig: the session's shell runs a TUI, then 8 MB of yes read 4 KB at a time, while three clients type; deltas go out before each input the authority steps and once a frame, acknowledgements and row requests come back over the links, every applied delta is checked against the authority's screen at that version and every terminal at quiescence. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* web: the browser shell builds again and loads a dump of a native build: a ↵Gabriel Schneider2026-10-29
| | | | | | | | | | theme by its name, a field compiled out passed over, no disk asked; touch.dump replaces the hand-written ZON fixture Fixed for wasm32-freestanding: counts as usize, no threads, stb_image, tape or host stat there. touch.mjs follows the renderer's 13 tag-layer fields, helix's retuned colours and the tag column. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* snapshots: dump, load, restore, tagnav and headersweep-restored show the ↵Gabriel Schneider2026-10-29
| | | | | | session as it was dumped: a terminal's view, its prompts hidden in text mode, a pane's message, typed text over its history Co-Authored-By: Claude Opus 5.5 <[email protected]>
* dump: one walker dump of the whole session, by name across builds, for ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | Restore, -l, Handover and the store; dump.zig's hand-written schema gone A dump is walk.zig's walk of the core with a table of every type it reaches (fields, enum and union names, number widths), read back by name; terminals are ghostty's snapshot (screens, history, kitty images); a failed load frees what it made. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* phase 5 part A: the speculation and rollback engine, in one process: a ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | | | | | walker copy put back where it was, replicas that apply their own input at once and take the authority's tape as the truth, and a harness of typists over delayed links src/rollback.zig: the replica core's allocator (`Epoch`) knows every allocation, and while a copy is held puts off frees of what was there before and refuses to grow it in place, so what the core held stays where it was. The copy (`Copy`) is the digest's walk saving the bytes of every allocation it reaches, field by field (the derived caches and this process's own too: a safe build's free writes over what it frees, and the frame arena points at what the epoch then frees), but the queues a step drains and the frame statistics; a file's text, its line index and its undo snapshots are pinned instead (made anew at each edit, never written; now freed raw everywhere), checked unchanged in a safe build. Put back, each allocation's bytes go back over it, the epoch's allocations are freed and its put-off frees forgotten; let go, they are made. Tree-sitter's trees, the C heap's, are held the same way (syntax.held_trees). src/replica.zig: an `Authority` records its core's every input to a tape in memory and hands each client's input back as a unit (origin, sequence number, its tape); a `Replica` applies its own input at once, as the authority will (update, then pump), recorded by its own tape (tape.zig's speculation mode), and for each unit in order drops its pending head when the authority recorded the same (inputs, host calls and answers: the fast path), else puts the copy back, replays the units since and this one (every digest checked) and applies its pending inputs again. A host call or a syscall stops a speculation: it is answered harmlessly, undone when it returns, and the input waits for the authority's answer; a clock or environment read is a guess the comparison checks; an emulator is the authority's (terminal.zig's writers stop a speculation; a safe build asserts none changed). The view's events (a resize, the pointer) wait. Messages are bytes: no transport yet. Each client has a view of its own (src/views.zig): the authority goes into it before the client's input (`toView`, taped), the replica's speculation the same, and the copy walks the views not live too (`parked`, each pane's `pv`). test/replicas.zig (`zig build replicas`): one authority and N replicas, a view each (`--shared` puts them in one), each client typing monkey.zig's mix at 50-200 ms over its own link (half the RTT plus 10% jitter, in order), the authority's pty echoing 2 ms later; gates: no replica diverges, every replica's digest is the authority's at quiescence; reported per RTT: inputs applied at once, stopped, waiting, fast paths, rollbacks (mispredicted, foreign), and what a speculative apply, a copy and a rollback cost. 3 clients x 100 inputs at 30, 80 and 207 ms: no divergence over 12 Debug seeds and 20 ReleaseFast ones with a filled heap; ReleaseFast p99 a speculative apply under 0.2 ms, a rollback under 1.6 ms. `zig build rollback-bench` times the real copy now (take, release, an edit, restore). What the replicas found, fixed: a release build reads what the heap had where Debug's fill made two cores agree: `col_panes` and `restore_buf` digested undefined (zeroed now), `terminal.State.reply_dropped` never set at create, `Text.sels` and `PendingPipe.ranges` digested past their length (a walker `len` cuts a slice too). PARDES_REPLICA_FILL fills a replica's allocations to show what is left. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* views: a terminal shown in a view shorter than it is passed down to its ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | cursor, a shell's prompt never out of sight, an arrow in the gutter where rows are above; a name drafted in a tag is the view's that opened it A terminal takes the size of the view that typed into it last; a shorter view used to show its top rows, the prompt below them cut. It now passes over as many as keep the cursor's row in sight, as tmux pans a bigger window in a smaller client: `Pane.pan` (per view, derived) is made in the step's sync and again when a view is drawn out of turn (views.unpark), by terminal.panFor (0 in the view that sizes it, in one tall enough, or folded), and read where the body's rows start: `Pane.scroll`, the body walk in tty mode, the visible cursor. One view never pans: the view that sizes a terminal returns 0 at its first test. A `.name` prompt (a file's name drafted in its tag) is the view's that opened it (`Pane.prompt_view`): another view's step, where that pane has not the keyboard, no longer drops it; its view closing does. views-pan.snap: a shell sized for a 24-row view, its last lines and prompt in a 12-row one under the arrow, then typed into from the short view and sized for it. A unit test: the short view's frame has the cursor's row, and the line on it, inside the pane. docs: the notes, the reference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* tape: every input the core consumes recorded in turn order, replayed into ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | | | | | | | replicas that must reach the same digests; the core's leaks of render, clock and host closed The recorder (src/tape.zig) is null unless PARDES_RECORD=<prefix> names a tape (<prefix><pid>.tape); the local path pays a null check a call. It records a tree at the host boundary, both ways: each call the host makes into the core (`Input`: update, serveFs, pump, perform, the shell's acknowledgements and failures, a Restore, ...) with its arguments, and each call the core makes out -- a Host function (the vtable wrapped generically while recording) or a syscall of its own (`tape.site` for every old `turn.yield()`, `tape.value` for a clock or environment read) -- with its result; `done`/`ret` close each, a 9P request served while a step is out lands inside that step's syscall, and fields a host writes between calls (native_images, present_skipped, ...) are found by a diff at every crossing. After each call the host made at the top, the session's digest (src/walk.zig), one per field of the core, its stream and each pane, file and places. `PARDES_REPLAY=<tape> pardes` (main.zig) replays it with the same build into three replicas: two at different addresses (the first's memory held while the second runs) and one that never draws. A host call answers what it answered, a site returns what it returned, nothing is performed and no syscall is made; `turn.yield` panics in a replica, so a syscall no site covers is a stack trace; a call the recording did not make, or a digest that differs, is a divergence that names the fields. The headless replica steps over the presents it does not make, applying what the host told the core inside them. What the replicas found, fixed: - Render wrote core state. The view's geometry (wrap map, context rows, body layer rows) is File.geometry, a lazy cache keyed by a hash of what it is made of (revision, scroll, size, tags, tables read, context declarations, the session's view: wrap, layered context, row metrics, rect); the render makes it afresh, a step reading it makes it on demand (wrapAt, wrapRow, ensureCursorVisible). Context declarations, notice bands and the header's reveal are the step's (sync), the tables' reading the tick's (a first look of 4096 lines, a count, wherever it is asked; the rest a frame's clock budget a tick), and a view's paint-ahead is asked of the host as the frame is drawn rather than queued as an effect. - The clock: advance's wakes are the recording session's (a picture decoding or a fade adds no tick to a replica), as are the budgets of Places, Names and Tables (`tape.over`), a message's time of day (the stamp; msg_said_ms and the unattended expiry use the session clock), File.mtime, and the pump reads its clock whether or not it waits. - The host: the session directory (getcwd, asked once at init), $SHELL and its existence, $HOME for `~`, `Shell` naming one that is not there, a missing interpreter, a directory refused above, a deleted file, a pointer seen through a sliding pane (Pardes.pointerCell). - Worker handles (futures, the Io), the 9P server's state, the store file every window shares (a replica keeps its own in memory) and Recent read from it are authority-only; frames, animations and the render's caches local. Query rows' paints count apart from a view's. Terminals replay from their taped pty bytes and are digested as their active screen, cursor and scroll; kitty images are left out until phase 5's screen-state terminals. tagnav.golden: the header's caret reveal now runs every step, as a pane's does, not once per frame drawn, so after `g l B B` typed in one burst the bar stays scrolled as a human typing it sees it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* kitty graphics conformance for terminal panes: a core suite (test/kitty.zig, ↵Gabriel Schneider2026-10-28
| | | | | | | | | | | | | | `zig build kitty-test`, in unit-test) and an end-to-end harness (`zig build kitty-harness`, tty and gui); four gaps it found fixed, one left The core suite feeds a pane's output as pty reads do and checks what the program reads back, ghostty's image storage and the ImagePlaces a frame draws: queries and their errors, q=0/1/2, f=24/32/100 and o=z, chunked m=1 split at every read size, t=f/t=t/t=s, a=T and C=1 cursor movement, a=p by placement id with source rects and re-puts, image numbers, every d= delete (a/A i/I n/N c/C p/P q/Q x/X y/Y z/Z r/R) and a delete abandoning a chunked load, Unicode placeholders over two rows with implicit columns and a placement named in the underline colour, scroll/resize/reflow, the alternate screen, clear (ED 2 + ED 3), replies per pane and never in the cells, many replies from one read, kitty before DA, CAN/SUB, an oversized image, 300 images against the storage limit, animations and relative placements. The harness runs test/kitty_client.zig in a pane's bash (query, a 16-chunk 8x4-cell place, the three media, quiet levels, CAN, show then delete) and kitten icat (stream and detect) and chafa when installed. Outside, the tty arm is a kitty terminal (a ghostty-vt emulator): the image pardes re-emits lands at the cell after ANCHOR>, 8x4 cells a row at a time, the client's own commands and replies never pass through, and d=I frees what was sent. The gui arm reads the GPU capture. Fixed: kitty file, temporary-file and shared-memory media (libghostty defaults to direct only; now allWithTempDir like ghostty and kitty); replies past 256 bytes of one read were cut mid-sequence (4 KiB now, an answer that does not fit dropped whole and counted); animations never played (TerminalImages draws renderData(), ticks ImageStorage.animationTick on the core clock, nextWake wakes for the next frame); relative placements (P=/Q=/H=/V=) were not drawn (resolveChain, as ghostty's renderer). image.decode no longer jumps through stb_image's null allocator before image.start. Known gap (a knownGap test): no z-index; every image is drawn over the cells in storage order. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* ghostty 1.4.0: pin the release (83fb9562), six days past the main commit we ↵Gabriel Schneider2026-10-28
| | | | | | | | | | | | | | had; vaxis and uucode stay on the commits it pins What reaches pardes: ED 3 now flags tracked pins on the history it erases `garbage` and takes away the kitty placements there (they used to come back at the pane's top), a cancelled or aborted APC runs nothing, and scrollClear keeps the cursor's style and hyperlink valid when it prunes the cursor's page. No API pardes calls changed. ED 3, decided by terminal.zig's own rule for rows that are gone: an edited copy or a selection (vsel, msel, the extra ranges) whose top row ED 3 erased goes, rather than being clamped to row 0. The undo history keeps its copy, at the top. `partial_clear_history` asserts it; MarkedHandler.lost and CommandOutput.whole say what ED 3 does now. Tests: ED 3 takes away a placement in the history it erases; a finished command's output erased by a later ED 3 is not whole and has no text; a selection on an erased row goes, one on the screen stays. CHANGELOG; docs/render-pipeline.md and Post.zig name ghostty 1.4.0 (its shadertoy Uniforms are unchanged). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Audit (misc): std mkdir -p and JSON escaping, a 9P late failure's errno from ↵Gabriel Schneider2026-10-23
| | | | | | ctl.failureErrno, dead switches and dumpHex out Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Callstack lists every caller and pages a tree too big for one query; memory ↵Gabriel Schneider2026-10-23
| | | | | | | | | | | | | | | | bounds and resident-size fixes Callstack walks while the server answers, counts on the message row past a second, puts test callers last at each level, and ends a tree past one query's memory (memory.limits.arena.lsp_query, a 256 MiB region taken and given back per query) in a row whose Callstack shows the next page. Grep reads whole files. New hard limits: undo text per file, image decode pixels, the LSP snapshot of other open files, one paste. Safe builds no longer fill worst-case buffers with 0xAA (memory.unfilled), big regions are kept off transparent huge pages, and malloc_trim runs after big results. Also: Look's git show pages into a +Diff, and dropped marks in File. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* zig fmt for Zig 0.17Gabriel Schneider2026-10-22
|
* Build with Zig 0.17Gabriel Schneider2026-10-22
| | | | | | | | | | | ghostty, libvaxis and uucode move to ghostty's 0.17 pins, cloud9 to its 0.17 main, SDL to castholm's release-3.4.x (3.4.18), zstbi and tree-sitter to forks with 0.17 build files (see build.zig.zon). A bare zig build copies the binaries into ~/.local/bin (-Dhome-install=false leaves it out): 0.17 keeps the prefix from build scripts. A terminal's edited copy goes when the program clears the screen. tinywin.snap is gone; perf baselines are re-recorded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Def and Refs in a language-served file's tag, a diff viewer's tinted word ↵Gabriel Schneider2026-10-22
| | | | | | | | | | edits, context rows that hold still under a scroll, and the pardes skill Def and Refs (gd, gr, Ctrl-click; chorded 2-1 at the selection) for a file a language server speaks for; hunks.zig stacks a unified diff as a diff viewer does, its changed words on a tinted ground as delta's do; the tree-sitter context rows stay put while the body glides under a scroll; .agents/skills gains the pardes skill beside pardes-9p.
* Insert on a terminal's text says it edits a copy, run with Tab or B2, that ↵Gabriel Schneider2026-10-02
| | | | | | the program's next drawing replaces, and that Ctrl-b types to the program Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An image's or a terminal's tag says petscii:on when it is drawn as glyph ↵Gabriel Schneider2026-10-01
| | | | | | | | art, as it always is with no graphics; Petscii on|off still chooses for when there are The images and tagbottomimage goldens are re-recorded for the word. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A terminal's petscii:on survives Dump and Restore: the dump says it, and the ↵Gabriel Schneider2026-10-01
| | | | | | | | | | restored terminal draws its graphics as glyph art again An image pane's Petscii choice was dumped; a terminal's was not, so a Restore brought it back drawing pixels. dump.Terminal carries petscii, and a restored terminal is turned to glyph art when it was. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A shell's prompt drawn on the alternate screen is a prompt: a terminal whose ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | | | | | | program was killed there is no longer busy for ever htop killed with `sig KILL` leaves the emulator on its alternate screen; bash comes back and draws its prompt there, marks and all, but promptInputReady refused any prompt on the alternate screen, so pty/status said busy 1 and pty/run answered a bare `busy` for good. A prompt mark there now counts. A run sent at such a prompt leaves the alternate screen in the emulator first, as a reused command pane does, so its output lands on the primary screen and is read whole, not `exit 0 cut` with nothing. Busy there with no prompt drawn, and no program name to give, a run is told `busy alternate screen`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* pty/run after a clear answers what the command printed from the clear on, ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | | whole; cut only when its start really scrolled away A clear (ED 2, ED 3, a reset) under a running command marked its output lost, so `clear; ls` answered only "exit 0 cut". The output's start is now pinned again at the screen's top after the erase: what the command prints from there is its answer, whole, and a cut is said only when that start leaves the scrollback. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A terminal's kitty graphics draw as glyph art where pixels cannot, and by ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | | | | | | | | | | choice: Petscii on the pane, TermImages for new ones Under an outer terminal without kitty graphics a tty pardes cannot pass a terminal pane's images on, so it draws them itself as an image pane's Petscii does: each row of an image is matched to C64-palette glyph art over the cells it covers (GlyphArt.renderRect, the exact-grid half of GlyphArt.render), cached while it is on screen. yazi is still told the kitty protocol works, so it keeps sending its previews. The same art is a choice anywhere: the Petscii builtin now takes a terminal pane too (PaneKind.picture), flipping its images between pixels and glyphs, and a terminal holding images, or drawing them as glyphs by choice, says petscii:on|off in its tag as an image pane does. TermImages real|petscii (default real) is what a new terminal starts with; it is in DumpConfig, /ctl and the reference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A terminal pane draws the kitty graphics its program places, so yazi's image ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and PDF previews show yazi asks the pane XTVERSION, and ghostty-vt answers "libghostty": yazi takes it for Ghostty and sends its previews by the kitty graphics protocol with Unicode placeholders (a=T,U=1, then U+10EEEE cells). ghostty-vt stored the images, but nothing drew them: the placeholders showed as tofu in the GUI and as raw codepoints in the tty, in every build since terminal panes answered queries (vkznsvzs, 2026-07-01). Before that no query was answered and yazi fell back to chafa's text art. Each frame, TerminalImages.zig reads the active screen's images and placements (virtual ones through their placeholder runs, and ones placed on a cell), cuts each into the cell rows it covers, maps those rows through the body's own row walk, clips them to the pane, and hands them on as ImagePlaces with exact geometry (NativePlacement.exact). The GUI draws them as textures; the tty passes them to an outer terminal with kitty graphics as one placement per row, its source cropped to whole cells. Placeholder cells draw no text. Scrolling, a delete, a resize, the alternate screen and a closed pane all fall out of reading the emulator's state every frame. A pane now knows its size in pixels: CSI 14/16/18 t are answered, the emulator's width_px/height_px follow the shell's cells, and the pty's winsize carries pixels (host_io.ptyWinsize), so yazi and a nested pardes size their images right. ghostty-vt's image store is 64 MiB per screen (its library default, 10 MB, refused a large preview), PNG transmissions are decoded with stb_image, and RGB images are converted only while shown. test/yazi_preview.py runs yazi in a hidden window on a PNG and a PDF and checks the captures, also through a tty pardes nested in the pane. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Release Pardes 0.9Gabriel Schneider2026-10-01
|\ | | | | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
| * A paste into a terminal is xterm's paste: bracketed when the program set ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | | | | | | | | | | | | | | 2004, and the control bytes a paste could smuggle a command in by, ESC first, become spaces, so no ESC[201~ in the text ends the brackets early Every paste path goes through edit.typeToTty (the GUI's and the tty's paste, p from a register, the acme chord's paste, a REPL's send), which now takes ghostty's paste encoder. A 9P write to a terminal's body or pty/data stays typed input, not a paste. The GUI test shell's stdin now takes a bracketed paste as one paste, as the tty does, not as keys. Co-Authored-By: Claude Opus 5.5 <[email protected]>
| * A program that asked for focus reports (1004) hears CSI I when its pane ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | | | | | | | | | | | | takes the keyboard and CSI O when it gives it up, to another pane, a tag or another window The core has a window-focus event now, from SDL's window focus and from the tty's own focus reports (vaxis turns 1004 on outside); the detached wire carries it: version 10. The test shell's ESC]777;mouse;focus;<1|0> fakes the window's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
| * A program that tracks the mouse gets its clicks, drags and moves over its ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | | | | | | | | | | | | | | grid, in the format it chose; Shift keeps pardes's select, execute and look, and chrome is never the program's Presses and releases under 1000, drags with a button down under 1002, every move once per cell under 1003, X10 presses under 9, in raw terminal input only. A press the program took keeps its drag and release, reported clamped to the grid's edge wherever the pointer goes. The press also makes the pane the active one. docs/tags.md says so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
| * A mouse event carries Shift and Alt as well as Ctrl, from SDL and from the ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | | | | | | | | | | | | tty's input; a program's wheel report carries them as xterm counts them, and Shift keeps the wheel pardes's own scroll The reports are ghostty's encoder now (shift+4, meta+8, ctrl+16), with the mode and format ghostty tracks. The detached wire carries the two new bits: version 9. The test shell's ESC]777;mouse takes an optional fifth field of modifiers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* | Merge: round 26 + codex wheel (the 0.8 candidate)Gabriel Schneider2026-10-01
|\| | | | | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
| * A wheel over a terminal whose program owns it goes to the program: its mouse ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | report when it tracks the mouse, arrow keys on the alternate screen with alternate scroll, so codex, htop and less scroll codex 0.158 moved its chat onto the alternate screen with any-event SGR mouse tracking (1049, 1000/1002/1003/1006, 1007 off); its sign-in screen keeps 1007 on with tracking off. pardes never forwarded a wheel to a program, only scrolled ghostty's scrollback, which the alternate screen does not have, so the wheel did nothing there. A shell on the main screen still scrolls its scrollback as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* | A run whose output a redraw moved above its start answers cut, never an ↵Gabriel Schneider2026-10-01
|/ | | | | | | | | | | | | | | | | | empty whole pty/run reads a command's output between its C and D marks. When the end landed at or before the start, it answered `exit 0` with no output, as if nothing was printed. That happens when the shell redraws its prompt over the output, as it can in a window two rows high (winsize 10 2). Now only equal marks mean nothing was printed. An end at the top-left cell or above the start says `cut`, since how much was printed is not known. bash, fish, long lines and 3000-line outputs at winsize 10 2 all came back whole on this build, so the dogfood's loss could not be reproduced directly. The test drives the marks into the inverted case the loss needs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A terminal's rows asked for after its cached rows were dropped, before the ↵Gabriel Schneider2026-10-01
| | | | | | | | step's sweep, are scratch: the cached ones are freed, not overwritten dropPane clears the rows cache's pane but keeps its allocations until the next step's sweep, since they may still be borrowed. shellRows took a cache with no pane as free and wrote a new gpa-built entry over it, leaking the old one: the 9P monkey's seed 109 (a look searching a terminal after its pane was torn down in the same step) ended its session with the debug allocator's leak panic. A slot still holding rows now gets scratch rows, as one holding another pane's already did. A unit test drops and asks again under the testing allocator (it leaks without this). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Dumps and init files from before 0.0.4 load no more of their old tag ↵Gabriel Schneider2026-10-01
| | | | | | | | formats, and three orphan test scripts go A2: a restored pane's tag tail comes from the dump's tag_tail, which every dump since 0.0.4 writes; the 27 earlier default tails that were recognised to upgrade, restoreTail, tailClass, savedPrefix and restoreTailAt, pdf_view's and image's legacySavedPrefix, a terminal's TTY tag prefix and its raw output tail replay, and the ThemeSel, FontSel and ColumnTags words (init lines and dumped output names) go, with their tests; the CHANGELOG says so. A4: test/fs_soak.py, referenced nowhere (monkey9p.py does its work). A6: test/column_grip.py and test/look_placement.py, referenced nowhere; the six review scripts docs/ui-review.md names stay. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Terminal.zig is terminal.zig: a file of functions and no fields takes a ↵Gabriel Schneider2026-10-01
namespace's lowercase name The last of the deferred renames, now that the tty and theme agents have landed: panes.terminal at its importers, the alias lines in Text.zig and File.zig and panes.zig's own uses following. dump.zig's Terminal struct, a dump record, is not this. The served sources list and docs/design.typ name the new file. test/perf.zig's references change, so the three perf baselines take its new harness id with their numbers as recorded. No behaviour changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>