Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider support for terminal link extensions #72

Open
starpit opened this issue Nov 8, 2022 · 0 comments
Open

Consider support for terminal link extensions #72

starpit opened this issue Nov 8, 2022 · 0 comments

Comments

@starpit
Copy link

starpit commented Nov 8, 2022

Howdy! Some terminals seem to be offering an ansi extension to support terminal links.

ref: https://iterm2.com/documentation-escape-codes.html

the logic i think is something along these lines:

    const m = source.match(/\x1B\]8;;(.+)\u0007(.+)\x1B\]8;;\u0007/)
    if (m) {
      return (
        <span>
          {source.slice(0, m.index)}
          <a href={m[1]}>{m[2]}</a>
          {source.slice(m.index + m[0].length)}
         </span>
      )
    }
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

No branches or pull requests

1 participant