diff --git a/AGENTS.md b/AGENTS.md index 8437009..2f31e06 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -99,4 +99,4 @@ ELYTerminal. A terminal on GPUI and Ely components. `PRD.md` says what it does; - 2026-10-16: prompts and commands carry OSC 133 marks, which the owner asked for, read as Ghostty reads them: A or N starts a prompt, B or I ends it, C starts a command's output, and D ends the command with its status, D's first option, none when that is no number. The tap reads any program's marks before the parser, so it never sees the cursor: A's fresh line and L, which need it, are not done, and P adds nothing to A. Each session keeps the status its last command ended with. The integration marks what the shell leaves unmarked, and the user's prompt still sees the command's status. zsh: precmd reads `$?` and sends D after a command ran, preexec sends C, and a last precmd hook wraps PS1 in A and B under `prompt_percent`, which the first prompt says while it is off; it moves to the end of `precmd_functions` at each prompt, since a theme that sets PS1 in a hook of its own loads after it, and at the first prompt `sched +0` wraps it once more, since zsh runs due events after every precmd hook; that call returns the command's status, which the prompt shows, but it would reset `$pipestatus`, so it serves the first prompt alone. bash: PROMPT_COMMAND's first entry reads `$?`, which each entry resets, and its last wraps PS1. From bash 4.4 PS0 sends C and its subscript notes that a command ran, since bash prints no PS0 for an empty line, and the first entry sends D for it; both need `promptvars`, on by default. macOS's bash 3.2 has no PS0 and nothing else between reading a line and running it: its DEBUG trap runs for a key binding's command (`bind -x`) as for a typed one, with nothing to tell the two apart, runs for no line that is only a subshell, and under `extdebug` its status decides whether a command runs. So bash 3.2 sends no C, and Ghostty's automatic integration skips bash 3.2. Its D comes from PS1 once `\#`, the command number, has moved, which neither a key binding nor an empty line does; readline sends a prompt's escapes again at each redraw, so that D goes again with it, the same status. Every mark of a command rides an expansion, which `promptvars` turns on, so while it is off at start the script says so rather than mark nothing without a word. fish 4.3 marks its own prompts and commands, fish 4.0 all but B, older ones none: the script adds what the running fish lacks, around the prompt shown, and wraps it again when the user's changes. PowerShell: the prompt reads `$?` first and sets it back for the user's prompt through `Write-Error '' -ErrorAction Ignore`, which adds nothing to `$Error`. A failure ends with `$LASTEXITCODE` when a program set it during the line, since each run stores a new object, equal or not, which `[object]::ReferenceEquals` tells apart, unless the line surely ends in PowerShell: its syntax tree, read as PSReadLine hands the line over, ends in a cmdlet, as `Get-Command` resolves the name, aliases through, in a name not found, or in no command; such a line ends with 1, a cmdlet's failure under `-ErrorAction Ignore` too. A line that ends in a block, a function, a script or a call through a variable takes the code of a program it ran: only a hook on every command lookup would name the last command run, and it slowed a loop of commands by half. `$LASTEXITCODE` is read through `Get-Variable`, since strict mode refuses an unset variable and a prompt that fails falls back to `PS>`. C goes out when PSReadLine hands over a line that is not blank; without PSReadLine the script says it marks no command. herdr passes no OSC 133 on, so a session running herdr keeps the status from before it. - 2026-10-16: the view jumps between prompts, which the owner asked for, as Ghostty jumps: Cmd-Up and Cmd-Down, with Shift or without, on macOS, Ctrl-Shift-Up and Ctrl-Shift-Down elsewhere, scroll to the prompt that starts before or after the view's top; a prompt on the screen's last page means the bottom, which the view cannot pass, and with none there nothing moves. alacritty's rows hold no marks, and the tap, which reads before the parser, never sees the cursor, so the tap rewrites what goes to the parser: an OSC that may be a mark is held whole until it ends and read as `marks` reads it, and a prompt's start becomes an OSC 8 link of the terminal's own, its target `\x7f`, which no program names, its id `\x7f` and the prompt's number; the prompt's end closes it. The parser stamps each cell the prompt prints with the link, SGR 0 keeps it, and it rides the cells through scroll, reflow and history; a prompt starts on the first row that shows its number, blank rows within it passed. A program's own link keeps its target and takes the prompt's number in its id: one opened inside a prompt carries it, and a prompt that starts inside one opens it again with the number and gives back its own id at the prompt's end, its target kept whole as the scanner keeps it; its end inside a prompt takes the prompt's link up again. A cursor restore that brings back a link passes the rewrite by. An OSC held, a body of 4096 bytes at most as the scanner keeps it and twice that with the controls vte skips, shows nothing until it ends; controls vte runs inside an escape go on before an ESC that waits, and only an ESC from ground waits: one that ends an OSC goes on with it, so what follows runs where the parser stands. A rewrite turns a mark of 8 bytes inside a program's link into that link again, its target up to 4096 bytes, so the tap reads about 2 KB of the buffer's room at a time, which moved 3 MB through a pty as fast as larger reads. Links, Cmd-press among them, pass over the prompt's link. The tap's OSC scanner ends a body as vte does, at BEL, ESC, CAN or SUB, and skips the controls vte skips, so a mark and its link agree. - 2026-10-17: programs say what they are doing through OSC 7501, revision 0.4 of the Program Status Protocol, which the owner asked for, read as the spec reads it: pairs `key=value` joined by `:`, a malformed pair skipped, an unknown key passed by, and every pair of a known key checked, a clear's too, before the last of each key is kept. A sequence over 4096 bytes, counted from OSC through ST with the controls its body skips, a key over 16, an app over 32, an id outside its grammar or limits (128 bytes, 32 a segment, 8 levels), a title or msg over its limits, not base64, not UTF-8 or holding a control character, and a missing or unknown state each drop it whole; kind counts only with blocked, and progress, 0 to 100, only with working and blocked, each absent when unknown. Each terminal keeps its records by id, the root's empty: a report replaces its record whole, clear drops the record and those under it, or all without an id, and past 256 the record updated longest ago goes. A new prompt drops working, blocked and idle records, as kitty does, and keeps done and error; a full reset, which the tap's scanner sees as `ESC c`, through the controls, DEL and high bytes vte passes by in an escape, drops all, and DECSTR nothing. The query `OSC 7501 ; ?` is answered with every state and kind; the view writes the answer when the session hears the query, ahead of the parser's answers to what came later in the same read, so a DA1 sent after the query, as the spec suggests, comes back second, and one sent before it in the same read comes back after it. -- 2026-10-17: programs ask for notifications through OSC 9, 777 and 99 and report progress through OSC 9;4, which the owner asked for. OSC 9 is ConEmu's command where Ghostty reads one, 9;1 to 9;12 each by its own shape, else iTerm2's notification, its text the title; OSC 777 is rxvt's `notify;title;body`, another extension logged and passed by. OSC 99 is kitty's: `k=v` pairs before the payload, a malformed pair passed by; `i`, of `[A-Za-z0-9_-+.]` alone or the sequence drops, gathers chunks while `d=0`, 32 notifications and 16384 bytes of text at most; `e=1` reads the payload as base64; a payload holds 2048 bytes plain or 4096 encoded at most, UTF-8 without a control character; `p` takes title, body, close, ? and alive, and other payloads pass by; `o`, `a`, `c` and `w` are kept for showing; a lone body is the title, and one with neither passes by. The query is answered with what is read so far, `p=title,body,?,alive:o=always`, and alive with no id, since none shows yet; an answer names the asker's id, or 0. OSC 9;4's states, remove, set, error, indeterminate and pause, read as Ghostty reads them, the progress clamped to 100, stand as the root record: set and pause working with their progress, indeterminate working without, error an error, remove none; this lasts until a program reports through OSC 7501, and again after a full reset, as the spec asks, so a mapped 9;4 never wipes a real report. Notifications go to the workspace, which logs them. +- 2026-10-17: programs ask for notifications through OSC 9, 777 and 99 and report progress through OSC 9;4, which the owner asked for. OSC 9 is ConEmu's command where Ghostty reads one, 9;1 to 9;12 each by its own shape, else iTerm2's notification, its text the title; OSC 777 is rxvt's `notify;title;body`, another extension logged and passed by. OSC 99 is kitty's: `k=v` pairs before the payload, a malformed pair passed by; `i`, of `[A-Za-z0-9_-+.]` alone or the sequence drops, gathers chunks while `d=0`, 32 notifications and 16384 bytes of text at most; a payload holds 2048 bytes plain or 4096 encoded at most; plain text is UTF-8 without a control character; `e=1` reads it as base64 group by group, so chunks split before encoding or after join, and it carries any UTF-8, newlines too, checked once the text is whole; a chunk that breaks a rule drops what its notification gathered; metadata holds 1024 bytes at most, and the tap keeps an OSC 99 body to 5124 bytes, room for metadata and a full payload, where other bodies stop at 4096; `p` takes title, body, close, ? and alive, and other payloads pass by; `o`, `a`, `c` and `w` are kept for showing; a lone body is the title, and one with neither passes by. The query is answered with what is read so far, `p=title,body,?,alive:o=always`, and alive with no id, since none shows yet; an answer names the asker's id, or 0. OSC 9;4's states, remove, set, error, indeterminate and pause, read as Ghostty reads them, the progress clamped to 100, stand as the root record: set and pause working with their progress, indeterminate working without, error an error, remove none; this lasts until a program reports through OSC 7501, and again after a full reset, as the spec asks, so a mapped 9;4 never wipes a real report. Notifications go to the workspace, which logs them. diff --git a/src/term/notify.rs b/src/term/notify.rs index 287c7c0..008a001 100644 --- a/src/term/notify.rs +++ b/src/term/notify.rs @@ -151,18 +151,78 @@ pub fn alive(id: &str) -> String { format!("\x1b]99;i={id}:p=alive;\x1b\\") } -/// An OSC 99 payload's most bytes: plain, and base64. +/// An OSC 99 payload's most bytes: plain, and base64; and its metadata's. const PLAIN: usize = 2048; const ENCODED: usize = 4096; +const METADATA: usize = 1024; + +/// The longest OSC 99 body the tap's scanner keeps: `99;`, metadata, `;` and a payload. +pub(super) const BODY: usize = 3 + METADATA + 1 + ENCODED; /// The most text one notification gathers from its chunks, and how many gather at once. const GATHERED: usize = 16384; const PENDING: usize = 32; +/// A payload gathering its chunks: its bytes so far, and base64 short of a whole group. +#[derive(Default)] +struct Text { + bytes: Vec, + rest: Vec, +} + +impl Text { + /// Adds a chunk: plain text as it is, base64 by whole groups, so a program may chunk before encoding or after. + fn add(&mut self, payload: &[u8], encoded: bool) -> Result<(), String> { + // Plain text is UTF-8 without a control character; base64 holds any UTF-8, checked once whole. + if !encoded { + let text = std::str::from_utf8(payload).map_err(|_| "payload is not UTF-8")?; + if text.chars().any(char::is_control) { + return Err("payload holds a control character".into()); + } + self.finish()?; + self.bytes.extend_from_slice(payload); + return Ok(()); + } + self.rest.extend_from_slice(payload); + let whole = self.rest.len() / 4 * 4; + for group in self.rest[..whole].chunks(4) { + self.bytes.extend(decode(group)?); + } + self.rest.drain(..whole); + Ok(()) + } + + /// Decodes the base64 left, padded or not, as the last chunk may leave it. + fn finish(&mut self) -> Result<(), String> { + if !self.rest.is_empty() { + self.bytes.extend(decode(&self.rest)?); + self.rest.clear(); + } + Ok(()) + } + + fn len(&self) -> usize { + self.bytes.len() + self.rest.len() + } +} + +fn decode(base64: &[u8]) -> Result, String> { + BASE64 + .decode(base64) + .map_err(|error| format!("payload is no base64: {error}")) +} + +/// A notification gathering its chunks. +struct Gathering { + notice: Notice, + title: Text, + body: Text, +} + /// OSC 99 notifications gathered from their chunks, by id. #[derive(Default)] pub(crate) struct Kitty { - pending: Vec<(String, Notice)>, + pending: Vec<(String, Gathering)>, } impl Kitty { @@ -180,6 +240,9 @@ impl Kitty { .position(|&byte| byte == b';') .ok_or("no payload")?; let (metadata, payload) = (&body[..at], &body[at + 1..]); + if metadata.len() > METADATA { + return Err(format!("metadata over {METADATA} bytes")); + } let mut options: Vec<(u8, &[u8])> = Vec::new(); for pair in metadata .split(|&byte| byte == b':') @@ -218,17 +281,6 @@ impl Kitty { if payload.len() > limit { return Err(format!("a payload over {limit} bytes")); } - let text = if encoded { - let bytes = BASE64 - .decode(payload) - .map_err(|error| format!("payload is no base64: {error}"))?; - String::from_utf8(bytes).map_err(|_| "payload is not UTF-8")? - } else { - String::from_utf8(payload.to_vec()).map_err(|_| "payload is not UTF-8")? - }; - if text.chars().any(char::is_control) { - return Err("payload holds a control character".into()); - } // An answer names the asker's id, or 0 without one, as kitty's spec says. let named = || id.clone().unwrap_or_else(|| "0".into()); match get(b'p').unwrap_or(b"title") { @@ -251,26 +303,38 @@ impl Kitty { return Err(format!("{PENDING} notifications gathering already")); } None => { + let notice = Notice { + id: id.clone(), + ..plain(String::new(), String::new()) + }; + let (title, body) = (Text::default(), Text::default()); self.pending.push(( - key.clone(), - Notice { - id: id.clone(), - ..plain(String::new(), String::new()) + key, + Gathering { + notice, + title, + body, }, )); self.pending.len() - 1 } }; - let notice = &mut self.pending[at].1; - if get(b'p') == Some(b"body") { - notice.body.push_str(&text); + let gathering = &mut self.pending[at].1; + let text = if get(b'p') == Some(b"body") { + &mut gathering.body } else { - notice.title.push_str(&text); + &mut gathering.title + }; + // A chunk that breaks the rules drops what its notification gathered. + if let Err(why) = text.add(payload, encoded) { + self.pending.remove(at); + return Err(why); } - if notice.title.len() + notice.body.len() > GATHERED { + if gathering.title.len() + gathering.body.len() > GATHERED { self.pending.remove(at); return Err(format!("a notification over {GATHERED} bytes")); } + let notice = &mut gathering.notice; if let Some(occasion) = get(b'o') { notice.occasion = match occasion { b"unfocused" => Occasion::Unfocused, @@ -303,7 +367,16 @@ impl Kitty { if get(b'd') == Some(b"0") { return Ok(None); } - let (_, mut notice) = self.pending.remove(at); + let (_, gathering) = self.pending.remove(at); + let Gathering { + mut notice, + mut title, + mut body, + } = gathering; + title.finish()?; + body.finish()?; + notice.title = String::from_utf8(title.bytes).map_err(|_| "title is not UTF-8")?; + notice.body = String::from_utf8(body.bytes).map_err(|_| "body is not UTF-8")?; if notice.title.is_empty() && notice.body.is_empty() { return Ok(None); } diff --git a/src/term/notify/tests.rs b/src/term/notify/tests.rs index c375d5d..3628bba 100644 --- a/src/term/notify/tests.rs +++ b/src/term/notify/tests.rs @@ -121,6 +121,34 @@ fn osc_99_decodes_base64_and_takes_plain_text() { ); } +#[test] +fn osc_99_gathers_base64_chunked_before_or_after_encoding() { + let title = |chunks: &[&str]| { + let mut kitty = Kitty::default(); + let (last, first) = chunks.split_last().expect("a chunk"); + for chunk in first { + assert_eq!(kitty.read(format!("i=a:d=0:e=1;{chunk}").as_bytes()), None); + } + shown(kitty.read(format!("i=a:e=1;{last}").as_bytes())).title + }; + assert_eq!(title(&["SGVsb", "G8="]), "Hello", "split inside a group"); + assert_eq!(title(&["8J+Y", "gA=="]), "😀", "split inside a character"); + assert_eq!( + title(&["SGVsbG8=", "IHdvcmxk"]), + "Hello world", + "each chunk padded" + ); + assert_eq!(title(&["SGVsbG", "8"]), "Hello", "the last chunk unpadded"); + let mut kitty = Kitty::default(); + assert_eq!(kitty.read(b"i=n:d=0;Title"), None); + let notice = shown(kitty.read(b"i=n:p=body:e=1;TGluZSAxCkxpbmUgMg==")); + assert_eq!( + (notice.title.as_str(), notice.body.as_str()), + ("Title", "Line 1\nLine 2"), + "base64 carries any UTF-8" + ); +} + #[test] fn osc_99_asks_to_close_and_what_is_alive_and_supported() { let mut kitty = Kitty::default(); @@ -158,8 +186,11 @@ fn osc_99_drops_what_breaks_its_rules() { body.push(byte); body }), + b";a\tb".to_vec(), + b"e=1;SGVsbG8gS".to_vec(), long(PLAIN + 1, ""), long(ENCODED + 4, "e=1"), + long(1, &"x".repeat(METADATA + 1)), ] { assert_eq!( kitty.read(&body), @@ -168,6 +199,9 @@ fn osc_99_drops_what_breaks_its_rules() { String::from_utf8_lossy(&body) ); } + assert_eq!(kitty.read(b"i=k:d=0;Hel"), None); + assert_eq!(kitty.read(b"i=k:d=0:e=1;!!!!"), None); + assert!(kitty.pending.is_empty(), "a bad chunk drops what gathered"); for at in 0..PENDING { assert_eq!(kitty.read(format!("i=p{at}:d=0;x").as_bytes()), None); } diff --git a/src/term/pty/tests.rs b/src/term/pty/tests.rs index 1da17ff..170c3f2 100644 --- a/src/term/pty/tests.rs +++ b/src/term/pty/tests.rs @@ -147,6 +147,20 @@ fn notifications_and_progress_reach_the_session_in_order() { assert_eq!(ran.text, "x"); } +#[test] +fn osc_99_gathers_a_full_encoded_chunk_and_the_lines_base64_carries() { + let ran = run( + "printf '\\033]99;i=m:d=0:e=1;'; yes YWFh | head -n 1024 | tr -d '\\n'; printf '\\033\\\\\\033]99;i=m:d=0:e=1;RU5E\\033\\\\\\033]99;i=m:p=body:e=1;TGluZSAxCkxpbmUgMg==\\007x'", + (40, 4), + ); + let [Ask::Show(notice)] = ran.asks.as_slice() else { + panic!("one notification: {:?}", ran.asks); + }; + assert_eq!(notice.title, format!("{}END", "a".repeat(3072))); + assert_eq!(notice.body, "Line 1\nLine 2"); + assert_eq!(ran.text, "x"); +} + #[test] fn a_long_escape_of_controls_keeps_the_pty_reading() { let ran = run( diff --git a/src/term/tap.rs b/src/term/tap.rs index 2c211bf..c8343a1 100644 --- a/src/term/tap.rs +++ b/src/term/tap.rs @@ -239,7 +239,7 @@ impl Osc { } (State::Osc, byte) => { self.length += 1; - if self.body.len() < MOST { + if self.body.len() < self.most() { self.body.push(byte); } else { self.overflow = true; @@ -251,9 +251,18 @@ impl Osc { } } + /// The longest body kept: an OSC 99 holds a payload of 4096 bytes past its metadata. + fn most(&self) -> usize { + if self.body.starts_with(b"99;") { + notify::BODY + } else { + MOST + } + } + fn finish(&mut self, end: usize, found: &mut impl FnMut(Found)) { if self.overflow { - log::warn!("pty: an OSC over {MOST} bytes dropped"); + log::warn!("pty: an OSC over {} bytes dropped", self.most()); } else { found(Found::Osc(&self.body, self.length + end)); } diff --git a/src/term/tap/tests.rs b/src/term/tap/tests.rs index 6bdbee3..571e767 100644 --- a/src/term/tap/tests.rs +++ b/src/term/tap/tests.rs @@ -74,6 +74,13 @@ fn an_overlong_body_is_dropped() { assert_eq!(scan(&[&long, b"\x1b]7;b\x07"]), ["7;b"]); } +#[test] +fn an_osc_99_body_holds_its_metadata_and_a_full_payload() { + let osc = |length: usize| [&b"\x1b]99;"[..], &vec![b'a'; length - 3], b"\x07"].concat(); + assert_eq!(scan(&[&osc(notify::BODY)]).concat().len(), notify::BODY); + assert!(scan(&[&osc(notify::BODY + 1)]).is_empty()); +} + #[test] fn mouse_modes_follow_private_modes_in_order_across_reads() { use crate::term::mouse::{Format, Tracking}; diff --git a/tasks/acceptance.md b/tasks/acceptance.md index f5d5938..b20fb4a 100644 --- a/tasks/acceptance.md +++ b/tasks/acceptance.md @@ -54,7 +54,7 @@ What no check reached: no real KWin drew the blur; of Wayland desktops, only Hyp | Prompt marks, OSC 133, from the shell integration and any program; each session keeps its last command's status | T34 | `term::marks` tests: each letter and option as Ghostty reads them; `term::tap` and `term::pty` tests: marks split across reads reach the session in order; `term::shell` tests: zsh, bash, fish and PowerShell send C, D;1, A and B around a failing command, and the user's prompt still shows the failure, a zsh theme's that sets PS1 in its own hook too, whose first prompt is marked before any command, and `$pipestatus` stays; bash's lone subshell ends with D;7, `$_` stays, a command runs under `extdebug` after a failure, a key binding marks nothing, the user's DEBUG trap runs, bash 3.2 sends no C, and bash says at start why it marks nothing while `promptvars` is off; PowerShell reads 1 for a cmdlet's failure under `-ErrorAction Ignore` after a success, a native code twice, a native failure's code under `$PSNativeCommandUseErrorActionPreference`, on a line that mixes a program and a cmdlet the cmdlet's 1, and through a call by variable the program's code; on macOS fish 4.9 marks itself and bash 3.2 marks no C, in the Linux container fish 4.0 gets B and bash 5.2 marks C through PS0, CI's Ubuntu runs fish 3.7, which the script marks whole; by hand in a pty, PowerShell under strict mode, and a cmdlet's failure after a native one's reads 1 | Pass | | Jump to the prompt before or after the view's top, as Ghostty jumps | T35 | `term::prompts` tests: a mark becomes its prompt's numbered link, read as the session reads marks, whole when split across reads at every byte, and other sequences, `133;AB` among them, pass as they came; a prompt's cells carry its link through SGR 0 and a resize, its input none; a program's own link and the prompt's keep each other, a program's link inside a prompt carries the prompt's number, a prompt inside a link left open too, a target of 264 bytes in either order; controls after an OSC's closing ESC keep their line; a long escape of controls keeps the pty reading; a prompt over rows starts at its first, blank rows within it too; up and down land as Ghostty's `scrollPrompt`; `term::links`: a prompt's link is no target; `term::pty`: through the event loop the prompt's cell alone carries it; in the app on macOS, Cmd-Up once and twice put PROMPT-3 and PROMPT-2 at the top, and Cmd-Shift-Down and Cmd-Down came back to the screen's bottom; the review's fixtures of a prompt that starts with a link and of a prompt with a blank row jumped to PROMPT-3-FIRST, and its fixture of `133;AB` marks found no prompt; the second review's fixtures of a prompt all in a link and of a linked first row jumped to PROMPT-3-FIRST. The keys off macOS are bound, not run | Pass | | Program status, OSC 7501 revision 0.4: reports checked as the spec checks them, records per terminal, a new prompt and a full reset, the support query | T36 | `term::status` tests: the spec's examples read as it means them; a malformed pair is skipped, the last of a key wins, unknown keys pass; a sequence over any limit, with bad base64, UTF-8 or a control character, or without a known state drops whole, a clear too, and an earlier pair of a key counts though the last wins; the sequence's length counts the controls its body skips; kind and progress count only with their states; records replace whole, clear with those under them, and past 256 the one updated longest ago goes; a new prompt keeps done and error alone. `term::tap`: a full reset found between bodies, and through DEL and high bytes in its escape. `term::pty`: a report, a query and a full reset reach the session in order through the event loop. In the app on macOS, a program that sent the query and then DA1 read the answer with every state and kind, then DA1's | Pass | -| Progress, OSC 9;4, as the root record until an OSC 7501 report; notifications, OSC 9, 777 and 99, read | T37 | `term::notify` tests: OSC 9 reads as Ghostty reads it, ConEmu's commands no notifications, 9;4's progress clamped; OSC 777's notify; OSC 99 gathers chunks by id and reads base64, options, close, query and alive, and drops what breaks its rules; its answers name the asker's id. `term::status`: 9;4 maps to the root record until a report, and again after a full reset. `term::pty`: OSC 9, 777, chunked 99 and 9;4 reach the session in order. In the app on macOS, a program read OSC 99's query and alive answers before DA1's, and four notifications reached the workspace's log | Pass | +| Progress, OSC 9;4, as the root record until an OSC 7501 report; notifications, OSC 9, 777 and 99, read | T37 | `term::notify` tests: OSC 9 reads as Ghostty reads it, ConEmu's commands no notifications, 9;4's progress clamped; OSC 777's notify; OSC 99 gathers chunks by id, base64 split before encoding or after and a character across chunks among them, keeps the newlines base64 carries, reads options, close, query and alive, and drops what breaks its rules with what it gathered; its answers name the asker's id. `term::tap`: an OSC 99 body keeps its metadata and a full payload. `term::status`: 9;4 maps to the root record until a report, and again after a full reset. `term::pty`: OSC 9, 777, chunked 99 and 9;4 reach the session in order, and a full encoded chunk with the lines base64 carries reaches it as one notification. In the app on macOS, a program read OSC 99's query and alive answers before DA1's, and four notifications reached the workspace's log | Pass | | Inside herdr, the folder of herdr's focused pane, read from its socket, on macOS, Linux and Windows | T29, T32 | `term::herdr` tests: the socket found as herdr 0.9 finds it, only the terminal client followed and a remote one refused, the snapshot read, a socket round trip, a process's path, arguments and variables; `the_foreground_is_the_program_s_own_group`; on X11 with herdr 0.9.5 run in the session: its start showed the focused pane's folder, a cd in the pane moved the panel, the focus moved to a pane in `/etc` and back moved it each time, and the client's end gave the panel back to bash's report, then `exec herdr` from that bash, with `HERDR_SOCKET_PATH` relative to its folder, was followed through the socket there; on macOS under `shot`, herdr 0.9.5 as the program and again by `exec` from `sh` with a relative socket, its pane's cd moved the panel; on Windows, `term::herdr` tests on the CI runner: the folder under `APPDATA` and `USERPROFILE`, the `herdr.exe` nearest under the shell, this test's name, arguments and variables read through the live process list and `sysinfo`, a round trip over a named pipe; no real herdr has run on Windows yet | Partial | | Colors, styles, five underlines, wide characters, combining marks | T06 | `term::frame`, `term::ink`, `term::paint` tests | Pass | | Box drawing, blocks and powerline shapes as geometry | T07 | `term::boxes` tests | Pass |