Skip to content

Comments

feat(tui): clickable hyperlinks via OSC 8#530

Merged
bug-ops merged 1 commit intomainfrom
feat/tui-osc8-hyperlinks
Feb 18, 2026
Merged

feat(tui): clickable hyperlinks via OSC 8#530
bug-ops merged 1 commit intomainfrom
feat/tui-osc8-hyperlinks

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 18, 2026

Summary

  • Detect URLs in TUI chat buffer and wrap them with OSC 8 escape sequences for terminal hyperlink support
  • Parse markdown links via pulldown-cmark Tag::Link with underline+cyan styling
  • Scan rendered buffer for bare https?:// URLs via regex post-render
  • Graceful degradation: terminals without OSC 8 silently ignore sequences

Files

  • crates/zeph-tui/src/hyperlink.rs (new) — URL regex, HyperlinkSpan, inject_osc8()
  • crates/zeph-tui/src/widgets/chat.rsMdRenderer Link handling, buffer scan + injection
  • crates/zeph-tui/src/theme.rslink style (Cyan, underlined)

Test plan

  • cargo build --features tui
  • cargo clippy --features tui -- -D warnings — zero warnings
  • cargo nextest run -p zeph-tui — 111 tests pass
  • Manual: verify clickable links in iTerm2/Kitty/Ghostty
  • Manual: verify no artifacts in Terminal.app (no OSC 8 support)

Closes #518

@github-actions github-actions bot added enhancement New feature or request rust dependencies size/M and removed enhancement New feature or request labels Feb 18, 2026
@bug-ops bug-ops force-pushed the feat/tui-osc8-hyperlinks branch from dd6ee60 to 37344cd Compare February 18, 2026 13:01
@github-actions github-actions bot added the enhancement New feature or request label Feb 18, 2026
@bug-ops bug-ops force-pushed the feat/tui-osc8-hyperlinks branch from 37344cd to cc7a2ff Compare February 18, 2026 13:06
@bug-ops bug-ops enabled auto-merge (squash) February 18, 2026 13:08
Detect URLs in rendered chat buffer and emit OSC 8 open/close
sequences directly to stdout after ratatui frame render. Markdown
links are parsed via pulldown-cmark Tag::Link and styled with
underline. Bare URLs are detected post-render via regex scan of
the buffer contents.

OSC 8 sequences are written via crossterm cursor positioning after
draw, avoiding ratatui buffer corruption. Terminals without OSC 8
support silently ignore the sequences.

Closes #518
@bug-ops bug-ops force-pushed the feat/tui-osc8-hyperlinks branch from cc7a2ff to 1f695bf Compare February 18, 2026 13:48
@bug-ops bug-ops merged commit e82b893 into main Feb 18, 2026
24 checks passed
@bug-ops bug-ops deleted the feat/tui-osc8-hyperlinks branch February 18, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI: clickable hyperlinks via OSC 8 escape sequences

1 participant