Skip to content

TUI: clickable hyperlinks via OSC 8 escape sequences #518

@bug-ops

Description

@bug-ops

Summary

Add clickable hyperlink support in TUI chat view using OSC 8 terminal escape sequences. URLs in model responses, file paths in tool output, and issue/PR references would become clickable.

Background

OSC 8 is widely supported by modern terminals: iTerm2, WezTerm, Kitty, Ghostty, Windows Terminal, GNOME Terminal. The escape sequence format is \033]8;;URL\033\\visible text\033]8;;\033\\.

Ratatui does not yet have native OSC 8 support (ratatui/ratatui#1227, status: Design Needed), so implementation would require either raw escape sequence output via crossterm or the osc8 crate.

Use Cases

  1. URLs in model responses — http/https links become clickable
  2. File paths in tool output — open in editor via file:// scheme
  3. GitHub references#123 links to issue/PR URL

Implementation Notes

  • Detect URLs in rendered text spans using regex
  • Wrap matched spans with OSC 8 open/close sequences before writing to terminal
  • Graceful degradation: terminals without OSC 8 support simply ignore the sequences
  • Consider feature-gating if the osc8 crate adds weight

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttuiTUI dashboard

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions