Skip to content

Make tool paths clickable - support OSC 8 hyperlinks #5168

@mpazik

Description

@mpazik

What do you want to change?

When scanning a session, file paths in read/write tool titles are plain text.
To open a file I have to copy the path and paste it elsewhere.

On terminals that support OSC 8 hyperlinks (iTerm2, Kitty, Ghostty, WezTerm, VS Code, Windows Terminal), the path could be a clickable file:// link that opens it directly.

I am using Ghostty terminal which is very opinionated about the link recognition and handling, and it only works when absolute path is present without the line annotation. Every terminal has its quircs there. The reliable approach is for the app to emit OSC 8 hyperlinks explicitly instead of relying on each terminal's heuristic.

Why?

Faster navigation between pi and editor, click instead of copy/paste.

How? (optional)

  • check if getCapabilities().hyperlinks is true
  • make a helper for link in render-utils.ts that respects the check
  • use it for buildin tools and provide helper for extension or do path auto detection (would need to think about it)

Happy to open a PR for this. Wanted to check first in case there are any objections to the feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions