Skip to content

fix(tui): reuse stable native hyperlink identities - #230

Merged
danielkov merged 1 commit into
mainfrom
fix/tui-stable-hyperlink-ids
Sep 16, 2026
Merged

danielkov merged 1 commit into
mainfrom
fix/tui-stable-hyperlink-ids

Conversation

@daviddanialy

Copy link
Copy Markdown
Contributor

Summary

  • Emit stable OSC-8 IDs derived from the full clipped link span and a BLAKE3 digest of the escaped destination, using the existing dependency.
  • Preserve main's single-pass rendering and unchanged-frame diff suppression. Partial text/style updates reuse the full link identity; separate spans and changed destinations remain distinct.
  • Add regressions for partial styling, adjacent duplicate destinations, overlay restoration, clipping at nonzero viewport origins, skipped cells, wide-cell transitions, and bounded parameter-safe IDs. Update the UI overlay test for explicit IDs.

Why

VS Code freeze samples after closing a Kit terminal showed xterm spending time in clearAllMarkers / marker disposal. Anonymous OSC-8 openings allocate new markers when linked cells are repainted. Stable IDs allow xterm to reuse those link records instead of accumulating them on repeated diffs.

This complements the single-pass renderer from #228: unchanged frames already avoid output, but content/style changes within existing links still emit OSC-8 opens.

Review and validation

  • Independent code review found no production correctness issues; strengthened coverage for the identified edge cases.
  • mise run test -- --lib tui:: -- --test-threads=1 passed after the final review changes.
  • mise run lint passed (format plus all-targets Clippy with all features and no default features).
  • CLI and startup-picker integration suites passed: 13 tests.
  • Fed actual renderer output into the installed VS Code xterm bundle: 10,000 partial redraws retained 3 markers, unchanged from the initial/warmed count. Verified destinations, overlay hide/restore, removal, and cursor position.

Existing validation limitations

The earlier full library run had 1,462 passes, 7 failures, and 5 ignored tests. Four failures passed on targeted retry. Two shell-output failures reproduce on the clean baseline because a local shell profile emits a missing-file warning into stderr. A Git credential/askpass test can stall on both baseline and patched builds; bounded retries were terminated. Parallel TUI signal-test interference also reproduces on the baseline, so the TUI suite was validated serially.

No claim of globally bounded marker storage for endlessly changing destinations or spans; this fixes repeated reuse of the same link. The separate Crossterm disconnect-loop issue is outside this PR.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

@danielkov
danielkov merged commit 523f1fb into main Sep 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants