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

Add support for hyperlink escape sequence #6139

Merged
merged 1 commit into from
Jul 10, 2022

Conversation

kchibisov
Copy link
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
Member Author

@perfbot

@kchibisov
Copy link
Member Author

@perfbot

1 similar comment
@kchibisov
Copy link
Member Author

@perfbot

@perfbot
Copy link

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
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.

alacritty.yml Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
alacritty_terminal/tests/ref.rs Show resolved Hide resolved
alacritty/src/config/ui_config.rs Outdated Show resolved Hide resolved
alacritty/src/config/ui_config.rs Show resolved Hide resolved
alacritty_terminal/src/ansi.rs Outdated Show resolved Hide resolved
alacritty_terminal/src/term/cell.rs Outdated Show resolved Hide resolved
alacritty_terminal/src/term/cell.rs Outdated Show resolved Hide resolved
alacritty_terminal/src/term/cell.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Show resolved Hide resolved
@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
alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Show resolved Hide resolved
alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
alacritty.yml Outdated Show resolved Hide resolved
alacritty_terminal/src/ansi.rs Outdated Show resolved Hide resolved
@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
Member

@perfbot

alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Show resolved Hide resolved
@perfbot
Copy link

perfbot commented Jul 7, 2022

results

@kchibisov kchibisov requested a review from chrisduerr July 9, 2022 17:14
@kchibisov
Copy link
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
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?

alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/display/mod.rs Outdated Show resolved Hide resolved
alacritty/src/string.rs Outdated Show resolved Hide resolved
@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
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

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
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