grid: OSC 8 with a control byte in params keeps the previous link #385

Closed
opened 2026-09-25 00:48:03 +09:00 by natsukium · 0 comments
Owner

A control byte in the OSC 8 params field (or a URI that fails sanitize_osc_str) leaves the previous hyperlink active on the pen, so the text that follows inherits it.

  • Contract: docs/reference/protocols/vt-compliance.md (OSC 8 bullet) and REQ-910 say a control byte in params and a disallowed-scheme URI both leave the pen unlinked, "rather than inheriting the previous one".
  • Code: crates/felis-grid/src/osc_dispatch.rs (~63-69) returns early on the params/URI sanitize failure without clearing current_link; only the disallowed-scheme arm (~76-79) clears it. The parser passes C0 bytes into the OSC body (felis-vt/src/machine.rs ~360-364), so the path is reachable.
  • Test gap: osc_dispatch/tests.rs (~293) starts with no open link, so inheritance is not pinned.

Fix: clear current_link on every reject arm, and add a test that opens a link, sends an OSC 8 with a control byte in params, and asserts the next printed cell carries no link.

Found by the docs consistency audit (branch docs/consistency-audit); the doc was kept as the contract.

A control byte in the OSC 8 `params` field (or a URI that fails `sanitize_osc_str`) leaves the previous hyperlink active on the pen, so the text that follows inherits it. - Contract: `docs/reference/protocols/vt-compliance.md` (OSC 8 bullet) and REQ-910 say a control byte in `params` and a disallowed-scheme URI both leave the pen unlinked, "rather than inheriting the previous one". - Code: `crates/felis-grid/src/osc_dispatch.rs` (~63-69) returns early on the params/URI sanitize failure without clearing `current_link`; only the disallowed-scheme arm (~76-79) clears it. The parser passes C0 bytes into the OSC body (`felis-vt/src/machine.rs` ~360-364), so the path is reachable. - Test gap: `osc_dispatch/tests.rs` (~293) starts with no open link, so inheritance is not pinned. Fix: clear `current_link` on every reject arm, and add a test that opens a link, sends an OSC 8 with a control byte in params, and asserts the next printed cell carries no link. Found by the docs consistency audit (branch `docs/consistency-audit`); the doc was kept as the contract.
Commenting is not possible because the repository is archived.
No description provided.