Skip to content

v0.8.6 feat(tui): clickable file:line in transcript — open in editor on click #374

@Hmbown

Description

@Hmbown

Pitch

Tool errors, stack traces, sandbox denials, and `grep_files` results constantly include `crates/tui/src/foo.rs:42:7` references. Right now they're plain text — copy, paste into another terminal, open manually. Make them clickable, like opencode/Cursor's terminal: click the path, it opens in $EDITOR (or jumps to that location in the user's IDE via a registered URL handler).

Implementation sketch

  1. Pattern-match `path/to/file.:(:)?` in transcript spans during the existing wrap pass.
  2. Wrap matches in a span with a hyperlink modifier (ratatui `Modifier::HYPERLINK` or a custom click-target tag).
  3. Register a mouse-click handler that resolves the path against `app.workspace` and either:
    • emits OSC-8 hyperlink escape so the terminal handles open natively (the cleanest cross-platform answer, supported by iTerm2 / Wezterm / Kitty / Windows Terminal); or
    • shells out to `$EDITOR + ` directly.
  4. Visual cue: underline + sky-blue when the cursor hovers (only when mouse capture is on).

Acceptance

  • Tool output containing `path:line` is rendered as a clickable hyperlink.
  • Click in iTerm2 / Wezterm / Windows Terminal opens the file at the right line.
  • No regression for users who don't have mouse capture enabled.
  • Doesn't break copy-paste of the raw path.

Prior art

Closed #323 covered the same surface area; reopening as a v0.8.6 deliverable since this lands well inside the polish window.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv0.8.6Targeting v0.8.6

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions