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 OSC 8 hyperlinks (HTML-like anchors) #427

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

geo-stark
Copy link

No description provided.

@cwendling
Copy link
Member

See also #175

@geo-stark
Copy link
Author

See also #175
My patches are just backported from gnome made by the author of the comment #175

@lukefromdc lukefromdc requested a review from a team February 3, 2023 20:42
@lukefromdc
Copy link
Member

I have no idea how to test this, would need to be able to do so without connection to unknown/unsafe sites

@geo-stark
Copy link
Author

geo-stark commented Feb 4, 2023

I have no idea how to test this, would need to be able to do so without connection to unknown/unsafe sites

Overall information about this feature: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
some quick tests:

  1. printf '\e]8;;https://ubuntu.com/\e\\Ubuntu 21.10\e]8;;\e\\n'
  2. ls --hyperlink=always

@lukefromdc
Copy link
Member

I don't really understand this, so will leave it for other team members to work on. I DO see a possible issue in your linked explanation though: autocompleting URLs could lead people to sites they don't ever want to connect to (e.g Facebook, Tiktok) or even to malware sites. Anything networked requires serious security, and coding it is out of my experience beyond blocking such sites on my machines.

@zhuyaliang
Copy link
Member

@geo-stark Thank you for your work. I am very interested in this new function. I will review the code when I have enough time

src/terminal-screen.c Outdated Show resolved Hide resolved
src/terminal-screen.c Outdated Show resolved Hide resolved
src/terminal-screen.c Outdated Show resolved Hide resolved
@vkareh
Copy link
Member

vkareh commented Mar 8, 2023

@lukefromdc

I don't really understand this, so will leave it for other team members to work on. I DO see a possible issue in your linked explanation though: autocompleting URLs could lead people to sites they don't ever want to connect to (e.g Facebook, Tiktok) or even to malware sites. Anything networked requires serious security, and coding it is out of my experience beyond blocking such sites on my machines.

This just affects rendering. What this does is expose functionality already available in VTE: hypertext linking. We already do the same thing with plain links, this just adds the hypertext portion.

Screenshot at 2023-03-08 12-24-55

Screenshot at 2023-03-08 12-25-14

Screenshot at 2023-03-08 12-25-27

src/terminal-util.c Outdated Show resolved Hide resolved
rename some url-related variables
rename TerminalURLFlavour enum to TerminalURLFlavor
backport of 0789b02ee11038743fde08795eb4a1ac0bcc3f47
from gnome-terminal to be a bit close to gnome-terminal source
@raveit65
Copy link
Member

@vkareh @geo-stark
What is the status of this?

@vkareh
Copy link
Member

vkareh commented Aug 29, 2023

This looks good to me. I just did a quick review of the code and tested it and it still works as I remember. I'm fine if we merge this.

@raveit65
Copy link
Member

@vkareh
Any chance to approve it :)

@geo-stark
Copy link
Author

geo-stark commented Aug 30, 2023

@vkareh @geo-stark What is the status of this?

I responded to all comments regarding the patches. If community has other questions \ suggestions I'm ready to answer it.

@raveit65
Copy link
Member

raveit65 commented Aug 30, 2023

I have no idea how to test this, would need to be able to do so without connection to unknown/unsafe sites

Overall information about this feature: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda some quick tests:

1. printf '\e]8;;[https://ubuntu.com/\e\\Ubuntu](https://ubuntu.com/%5Ce%5C%5CUbuntu) 21.10\e]8;;\e\\n'

2. ls --hyperlink=always

A better page for information seems to be here https://github.com/Alhadis/OSC8-Adoption

Copy link
Member

@raveit65 raveit65 left a comment

Choose a reason for hiding this comment

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

LGTM,
works fine with those example commands.
printf '\033]8;;http://example.com\033\\This is a link\033]8;;\033\\\n'
ls --hyperlink=always

src/terminal-window.c Outdated Show resolved Hide resolved
Copy link
Member

@vkareh vkareh left a comment

Choose a reason for hiding this comment

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

LGTM

backport of 1c6f8db736efc62d9a9b38bfbc43ec03c8544696
from gnome-terminal
in mailto scheme IDN coding may apply only to domain part
local part if not in ASCII must be unicode
@raveit65 raveit65 merged commit eed62e8 into mate-desktop:master Aug 31, 2023
1 check passed
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.

6 participants