Skip to content

Add support for hyperlink escape sequence#6139

Merged
kchibisov merged 1 commit intoalacritty:masterfrom
kchibisov:hyperlink-v2
Jul 10, 2022
Merged

Add support for hyperlink escape sequence#6139
kchibisov merged 1 commit intoalacritty:masterfrom
kchibisov:hyperlink-v2

Conversation

@kchibisov
Copy link
Copy Markdown
Member

This commit adds support for hyperlink escape sequence
OSC 8 ; params ; URI ST.

Fixes #922.

@kchibisov kchibisov requested a review from chrisduerr June 16, 2022 21:09
@kchibisov kchibisov force-pushed the hyperlink-v2 branch 2 times, most recently from 80a71c4 to b8f5d02 Compare June 16, 2022 21:25
@kchibisov
Copy link
Copy Markdown
Member Author

@perfbot

@kchibisov
Copy link
Copy Markdown
Member Author

@perfbot

1 similar comment
@kchibisov
Copy link
Copy Markdown
Member Author

@perfbot

@perfbot
Copy link
Copy Markdown

perfbot commented Jun 17, 2022

results

@alacritty alacritty deleted a comment from perfbot Jun 17, 2022
@alacritty alacritty deleted a comment from perfbot Jun 17, 2022
@kchibisov
Copy link
Copy Markdown
Member Author

@chrisduerr seems like I've managed to fix it. That's pretty interesting though, increasing the amount of attrs changed the way it gets optimized. Might consider splitting it even more, like moving color, etc related parts to a separate methods keeping attr in something like u8.

@kchibisov kchibisov requested a review from chrisduerr June 29, 2022 12:00
@kchibisov kchibisov force-pushed the hyperlink-v2 branch 2 times, most recently from 31430b8 to 88f3e9d Compare June 29, 2022 18:16
@kchibisov kchibisov modified the milestone: Version 0.11.0 Jun 29, 2022
@kchibisov kchibisov requested a review from chrisduerr July 6, 2022 00:24
@kchibisov kchibisov force-pushed the hyperlink-v2 branch 2 times, most recently from 599f2ed to 41776d5 Compare July 6, 2022 11:53
@chrisduerr
Copy link
Copy Markdown
Member

@perfbot

@perfbot
Copy link
Copy Markdown

perfbot commented Jul 7, 2022

results

@kchibisov kchibisov requested a review from chrisduerr July 9, 2022 17:14
@kchibisov
Copy link
Copy Markdown
Member Author

I've implemented an iterator for string shortening. Should work now in both directions and place a shoretener for regex strings in search bar.

Copy link
Copy Markdown
Member

@chrisduerr chrisduerr left a comment

Choose a reason for hiding this comment

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

I like the StrShortener implementation, in raw LoC count it might be a little more verbose but it's very descriptive and does what it's supposed to do well and clearly.

Could also easily be moved to another module if we want to reduce LoC count in display/mod.rs, which probably wouldn't be a terrible idea?

@kchibisov kchibisov requested a review from chrisduerr July 9, 2022 22:23
This commit adds support for hyperlink escape sequence
`OSC 8 ; params ; URI ST`. The configuration option responsible for
those is `hints.enabled.hyperlinks`.

Fixes alacritty#922.
@kchibisov kchibisov merged commit 694a52b into alacritty:master Jul 10, 2022
@afh
Copy link
Copy Markdown
Contributor

afh commented Jul 11, 2022

This is exciting! Thanks for all the hard work on this!! 🙌

kchibisov pushed a commit that referenced this pull request Jul 26, 2022
The end of the search window is currently calculated using the viewport
start instead of the end.  The observed behavior is that all hinting
stops suddenly after line 101.  This was introduced in #6139 when the
code was refactored into this file from display/content.rs.
@hasufell
Copy link
Copy Markdown

How does this work? Is it released? I tried to build from master and then executed:

printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'

It did not produce a clickable link.

@kchibisov
Copy link
Copy Markdown
Member Author

How does this work? Is it released? I tried to build from master and then executed:

Part of v0.11.0. Requires hyperlinks: true in the hints config (which is default) in case you have custom sections.

You could test with default config alacritty --config-file /dev/null Just hovering the mouse should show link preview and highlight the link.

Won't work in tmux unless you build it from master. Likely won't work on Windows, since ConPty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Support hyperlinks terminal escapes

5 participants