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

(ansi-term PR 61) Add hyperlink support #1

Merged
merged 1 commit into from
Aug 29, 2023
Merged

(ansi-term PR 61) Add hyperlink support #1

merged 1 commit into from
Aug 29, 2023

Conversation

gierens
Copy link
Member

@gierens gierens commented Aug 29, 2023

Some terminals support hyperlinks to URLs as a text style, defined at
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda .

Add support for these escape sequences to ansi_term, storing the
hyperlink target as an Option<Rc<str>>. This avoids copying URLs when
modifying styles.

This makes Style no longer Copy, so Style now requires .clone() when
duplicating it.

Note that this intentionally omits support for the `id` attribute, used
by screen-oriented applications to group separated links together as
"the same link". This arises when splitting links across lines within a
windowing or window-splitting mechanism. Applications with such use
cases will need other screen-oriented escape sequences that ansi_term
doesn't cover, as well.
@gierens gierens merged commit 0352743 into main Aug 29, 2023
6 checks passed
@gierens gierens mentioned this pull request Sep 6, 2023
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.

Request: hyperlink (HTML-like anchor)
2 participants