grid: end the open hyperlink when OSC 8 is rejected for a control byte #438

Merged
natsukium merged 2 commits from grid/osc8-reject-clears-link into main 2026-09-25 12:30:13 +09:00
Owner

An OSC 8 rejected for a control byte in its params, or for a URI that fails sanitize_osc_str (a control byte or invalid UTF-8), returned early without clearing current_link, so the text after it stayed linked to the previously opened URI. The contract (vt-compliance OSC 8 bullet, REQ-910) says every reject leaves the pen unlinked; only the disallowed-scheme arm did.

  • dispatch_osc_8 clears the pen before any check, so every reject arm agrees.
  • A test opens a link, sends each rejected form, prints, and asserts the new cell carries no link.
  • CAN / SUB cancel the OSC before it reaches the grid, as they cancel any sequence, so the open link stays on; the reference now names that as the exception, and a test pins it.
  • CHANGELOG: Fixed entry.

Closes #385

An OSC 8 rejected for a control byte in its params, or for a URI that fails `sanitize_osc_str` (a control byte or invalid UTF-8), returned early without clearing `current_link`, so the text after it stayed linked to the previously opened URI. The contract (vt-compliance OSC 8 bullet, REQ-910) says every reject leaves the pen unlinked; only the disallowed-scheme arm did. - `dispatch_osc_8` clears the pen before any check, so every reject arm agrees. - A test opens a link, sends each rejected form, prints, and asserts the new cell carries no link. - CAN / SUB cancel the OSC before it reaches the grid, as they cancel any sequence, so the open link stays on; the reference now names that as the exception, and a test pins it. - CHANGELOG: Fixed entry. Closes #385
REQ-910 and the vt-compliance contract say any rejected OSC 8 leaves the
pen unlinked. Only the disallowed-scheme arm cleared current_link; a
control byte in params or a URI failing sanitize returned early, so the
text after it kept the previous link and a producer could attribute it
to that earlier, safe URI. Clearing the pen before any check makes
every reject arm agree, and the test now starts from an open link so
inheritance is pinned.

Assisted-by: Claude Code
grid: pin that CAN and SUB cancel OSC 8 without touching the pen
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 13s
darwin / darwin docs-only no-op (pull_request) Has been skipped
bench / Criterion regression gate (pull_request) Has been cancelled
darwin / build felis (aarch64-darwin) (pull_request) Successful in 54s
darwin / publish felis (aarch64-darwin) (pull_request) Has been skipped
pr / frontend smoke (x86_64-linux) (pull_request) Has been cancelled
pr / publish felis (x86_64-linux) (pull_request) Has been cancelled
windows / cargo nextest (Windows) (pull_request) Failing after 3m28s
pr / nix flake check (pull_request) Has been cancelled
pr / cargo build / clippy / test / deny (pull_request) Has been cancelled
pr / wire schema is compatible with the base (pull_request) Has been cancelled
windows / frontend smoke (Windows) (pull_request) Has been skipped
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 20s
windows / windows docs-only no-op (pull_request) Has been skipped
fuzz / cargo fuzz smoke (per target) (pull_request) Has been cancelled
windows / cargo clippy (Windows cross) (pull_request) Successful in 13s
14826bf7c5
CAN and SUB abort a string sequence in the parser before anything is
dispatched, so a cancelled OSC 8 never reaches the reject arms that now
clear the pen; the link opened before it stays on, as for any other
cancelled sequence. The reference said every control byte in params
unlinks the pen, which read as covering these two as well; it now
names the cancel as the exception, and names the URI-side rejects
(control bytes, invalid UTF-8) the grid fix also covers. A test pins
the invalid-UTF-8 reject alongside the control-byte ones.

Assisted-by: Claude Code
natsukium deleted branch grid/osc8-reject-clears-link 2026-09-25 12:30:13 +09:00
Commenting is not possible because the repository is archived.
No description provided.