summaryrefslogtreecommitdiff
path: root/abi
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 18:35:03 -0300
committerGabriel Schneider <[email protected]>2026-11-27 12:56:41 -0300
commit7583f9a1d8342c6d779ef32cd40fa2cde5cf8977 (patch)
treecdc994a37e0a9e61cd246c738e5257486bb156c8 /abi
parent9890f44e4a18f08b6dcc62a69484b8e93640e1e6 (diff)
downloadpardes-7583f9a1d8342c6d779ef32cd40fa2cde5cf8977.tar.gz
pardes-7583f9a1d8342c6d779ef32cd40fa2cde5cf8977.zip
Panes say they are Ghostty (TERM_PROGRAM=ghostty, TERM_PROGRAM_VERSION=1.4.0, the pinned ghostty whose VT every pane runs), and a Look on a link (OSC 8) in a terminal takes its URI: the user's report of 2026-11-27 ("the terminal applications aren't detecting that we have kitty graphics support (codex for example)") and ruling ("Posing as ghostty is fine by me, it's a good measure for us to have feature parity with it anyways"); THE CAUSE: codex 0.172 decides on kitty images from the environment alone (a terminal-name list, TERM/TERM_PROGRAM substrings, KITTY_WINDOW_ID, WEZTERM_*; its kitty query only for TERM_PROGRAM=herdr; pets never ask), and panes said TERM_PROGRAM=pardes and inherited the launcher's TERM_PROGRAM_VERSION (rex's under rex); pardes answers codex's own probe (`\e_Gi=31;OK\e\\` before DA1) and draws its `a=T,f=100,c,r,C=1` image (.scratch/kp/run.py, run_img.py); WHY THE LINK: a program that knows it is in Ghostty shows a link's label alone (codex's web_link_display), and pardes kept OSC 8 only in the dump: the URL would be nowhere to Look at; THE CHANGE: config.child_term_program "ghostty", child_term_program_version "1.4.0" (host_io.ChildEnv writes it over the inherited one); Term op `link` (abi/term.zig, replicated as textRows is: READ, NOT COVERED, core/Term.zig's S1 row exec.zig:1): the URI of cell x of a row (from the top of the history) and its run's cells on that row, counted in the text with the prompt cut when out of tty mode; exec.operandAt (every entry point: B3, hover, Enter in normal mode, a bare Look): a look at a link takes its URI, a `file://` one its path (the host dropped, %XX decoded), expanded to the label's cells; an exec takes the label's word as before; docs/macos.md's identity paragraph; NOT DONE (Ghostty parity, listed for later): OSC 9/777 notifications, OSC 9;4 progress, OSC 22 pointer shapes, OSC 10/11 colour answers (the `dark` theme takes the host terminal's colours and views differ per client: a design first); RUN (TEST FIRST): exec.zig "a look at a link (OSC 8) in a terminal takes its URI, a file:// one its path, and expands to the label; out of tty mode too" (an https link and a file://box/tmp/a%20b.txt one, in tty and normal mode; off the link `see`, an exec `docs`): fails with the branch off (`the` for `https://ziglang.org`), passes now; REAL CHECK (.scratch/kp/link_e2e.py: this tree's Debug pardes --tty in a pty, TERM_PROGRAM=rex and TERM_PROGRAM_VERSION=9.9.9-outer outside): the shell pane printed `TP=ghostty TPV=1.4.0`; an SGR B3 on plain text beside the link opened nothing; on the label (file://somehost/…/target%20dir/linked.txt) it opened `target dir/linked.txt`; GATES (Debug tui): core-test 1165/1343 (178 skipped), shell-test 1392/1395 (3 skipped), term-test 17/17, kitty-test 45/45, process-test rc 0, behaviour-test 293/293
Diffstat (limited to 'abi')
-rw-r--r--abi/term.zig10
1 files changed, 9 insertions, 1 deletions
diff --git a/abi/term.zig b/abi/term.zig
index 4dfd523a..64541d00 100644
--- a/abi/term.zig
+++ b/abi/term.zig
@@ -238,6 +238,10 @@ pub const ImagesAt = struct {
/// marked it input, and its style's identity.
pub const EchoCell = struct { cp: u21, input: bool, style: u32 };
+/// A link (OSC 8) under a cell: its URI (the emulator's bytes: copied before
+/// the next feed) and the cells `lo..hi` its run takes on that row.
+pub const Link = struct { uri: []const u8, lo: u16, hi: u16 };
+
/// What the dump keeps of a terminal beside its emulator, by name as every
/// dump is (core/walk.zig, through the core's `Term.State`).
pub const Parts = struct {
@@ -356,6 +360,10 @@ pub const Ops = struct {
promptCut: *const fn (s: *State, row: i32) ?PromptCut,
/// What a predicted echo reads of cell `x`, `y` of its active area.
echoCell: *const fn (s: *const State, x: u16, y: u16) ?EchoCell,
+ /// The link (OSC 8) cell `x` of row `row` (from the top of its history)
+ /// carries; `cut`: `x` and the run counted in the row's text, a
+ /// prompt's own cells cut off (a view out of tty mode).
+ link: *const fn (s: *State, row: i32, x: u16, cut: bool) ?Link,
// ---- the pager ----
/// `raw`, a program's output, as a terminal reads it: its text and its
@@ -391,7 +399,7 @@ pub const replicated = [_][]const u8{
"open", "close", "revive", "digest", "parts", "snapshot", "load", "reload",
"media", "feed", "grid", "resize", "replies",
"key", "mouse", "wheel", "paste", "modes", "promptMoves", "prompt", "commandOutput",
- "endOutputHere", "scrollback", "scrollbackLen", "textRows", "viewport", "editRows", "promptCut", "page",
+ "endOutputHere", "scrollback", "scrollbackLen", "textRows", "link", "viewport", "editRows", "promptCut", "page",
"filter", "spanColor", "hasImages",
};
pub const local = [_][]const u8{ "start", "stop", "gpa", "due", "cellPixels", "echoCell", "paint", "images" };