Skip to content

fix(tui): render hyperlinks in one pass without cursor flicker - #228

Merged
danielkov merged 2 commits into
mainfrom
fix/tui-single-pass-hyperlinks
Sep 16, 2026
Merged

danielkov merged 2 commits into
mainfrom
fix/tui-single-pass-hyperlinks

Conversation

@danielkov

Copy link
Copy Markdown
Contributor

Summary

Render native terminal hyperlinks through a custom Ratatui backend instead of a separate post-frame repaint. Keep the cursor hidden during rendering and synchronize the complete frame to prevent cursor flashes at intermediate draw positions.

Technical details

Single-pass hyperlink updates

Merge hyperlink metadata changes with Ratatui鈥檚 cell diff so changed targets and removed links update even when their text is unchanged, without printing those cells twice. Preserve wide-grapheme draw ordering, skipped image cells, overlay behavior, and the exclusion of internal kit-image: targets from native hyperlinks.

Frame and cursor lifecycle

Route both TUI draw paths through a shared synchronized-update helper and defer cursor visibility until final positioning. Attempt hyperlink closure, cursor restoration, and synchronized-update cleanup after output errors; terminal panic cleanup also closes hyperlinks and ends synchronized updates.

@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.

Panic cleanup can leave the shell cursor invisible after a panic interrupts a synchronized frame.

Comment thread src/tui/mod.rs

@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 enabled auto-merge (squash) September 16, 2026 12:16
@danielkov
danielkov merged commit cee1b1a 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.

1 participant