diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 00:51:28 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 01:04:49 -0300 |
| commit | 4bcf2055cb97d0c69fc94643b3e43b579d6fa30c (patch) | |
| tree | cc845bdc25436aca800fb4791a9709ad913f3d32 /abi | |
| parent | 8e04bc6370916ac328f61ad0df6e3babeb9789b4 (diff) | |
| download | pardes-4bcf2055cb97d0c69fc94643b3e43b579d6fa30c.tar.gz pardes-4bcf2055cb97d0c69fc94643b3e43b579d6fa30c.zip | |
term: a kitty image's medium (a file, a temporary file, shared memory) is the session's read and a recorded answer on the tape, so every replica's emulator is handed the bytes the session read, or its failure, and never reads its own machine: ghostty's loader gets the bytes through `LoadingImage.read_medium` (an Edit in build/patches.zig, ghostty's own read handed to it, the report in docs/ghostty-kitty-medium.md), which the terminal module sets to the core's `Term.media`, a `tape.valueIn(.medium, ...)` site (a new Site; `valueIn` is `value` with the answer's slices in the loader's allocator, no yield inside a feed), so a read crosses to a client as a file read does (inline under 1 MiB, by hash at or over it), a temporary file is deleted and shared memory unlinked once, on the session, and the program is answered by the session alone; a replica no longer loads by direct data only: `Term.direct`, `State.direct` and the `direct` entry go (`media` in their place); under screen state the read stays the authority's (a screen-state replica feeds no emulator); FIRST the test through the replica's surface (a session and a bytes replica, four images shown, by a file, a temporary file, shared memory and a missing file): on the base the digests parted (expected 8810391091473565423, found 2236913079067993401: the replica's loader said "unsupported medium" and did not move its cursor), now they agree, the terminals dump the same bytes, the temporary file and the object are gone and the replica read nothing (ghostty's FileNotFound warned once); tui term-test 17/17, kitty-test 45/45, core-test 856/1007 (151 skipped), shell-test 1043/1046, unit-test -Dtest-filter=bytes: 23/23 (the perf check's BaselineHarnessMismatch, as on the base)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'abi')
| -rw-r--r-- | abi/term.zig | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/abi/term.zig b/abi/term.zig index 37519309..187b99e5 100644 --- a/abi/term.zig +++ b/abi/term.zig @@ -308,6 +308,14 @@ pub const Parts = struct { /// What reading its text can fail with. pub const TextError = error{ OutOfMemory, WriteFailed, UnknownPoint }; +/// How a kitty image's medium is had (a file, a temporary file, shared +/// memory: things of the session's machine): `read(ctx)` is the emulator's +/// own read (which deletes a temporary file and unlinks shared memory), +/// its bytes `gpa`'s (core/Term.zig `media`). +pub const Media = *const fn (ctx: *const anyopaque, read: *const fn (ctx: *const anyopaque) MediumError![]u8, gpa: std.mem.Allocator) MediumError![]u8; +/// What ghostty's loader fails a medium's read with. +pub const MediumError = error{ OutOfMemory, InvalidData, UnsupportedMedium, DimensionsTooLarge, TemporaryFileNotInTempDir, TemporaryFileNotNamedCorrectly }; + /// The entries, as `term.ops` gives them. An error set named here is what /// the core's callers name (the tape's `Failure` reads `open`'s, the text /// readers' are edit.zig's); `anyerror` where the core only passes one on @@ -347,8 +355,9 @@ pub const Ops = struct { /// Its emulator made again from its own snapshot where it is (a join: /// every side does it); the snapshot's hash. reload: *const fn (s: *State) anyerror!u64, - /// Its program's kitty images by direct data alone (a replica's). - direct: *const fn (s: *State) void, + /// How every terminal in the process has a kitty image's medium from + /// now on (the core's: a recorded answer). + media: *const fn (read: Media) void, // ---- output and view ---- /// One read of its program's output (`Told` says where the tracked |
