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

Emit terminal hyperlinks #19

Merged
merged 1 commit into from
Aug 24, 2024
Merged

Emit terminal hyperlinks #19

merged 1 commit into from
Aug 24, 2024

Conversation

AmaranthineCodices
Copy link
Collaborator

Implements enough of the terminal hyperlink specification to allow
us to include links to PRs, where they exist, in the terminal output.

This specification is implemented by several terminals, including:

  • kitty
  • wezterm
  • iTerm2
  • Alacritty
  • Windows Terminal
  • Konsole
  • xterm.js (VS Code's backing terminal implementation)

See this tracking repository for a full listing.

The ECMA-48 specification requires that terminals that do not understand
the OSC-8 command code silently ignore it; in compliant terminals that
do not implement the hyperlink specification, users will simply observe
no changes to the output of stack-pr. For cases where outputting these
escape codes is still undesirable I have added a --no-hyperlinks flag.

Implements enough of the [terminal hyperlink specification][1] to allow
us to include links to PRs, where they exist, in the terminal output.

This specification is implemented by several terminals, including:
- kitty
- wezterm
- iTerm2
- Alacritty
- Windows Terminal
- Konsole
- xterm.js (VS Code's backing terminal implementation)

See [this tracking repository][2] for a full listing.

The ECMA-48 specification requires that terminals that do not understand
the OSC-8 command code silently ignore it; in compliant terminals that
do not implement the hyperlink specification, users will simply observe
no changes to the output of `stack-pr`. For cases where outputting these
escape codes is still undesirable I have added a `--no-hyperlinks` flag.

[1]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
[2]: https://github.com/Alhadis/OSC8-Adoption/
Copy link
Collaborator

@ZolotukhinM ZolotukhinM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@ZolotukhinM ZolotukhinM merged commit ea8bc06 into main Aug 24, 2024
2 checks passed
@ZolotukhinM ZolotukhinM deleted the lbrown/terminal-hyperlinks branch August 24, 2024 17:43
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

Successfully merging this pull request may close these issues.

2 participants