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

Contextual menu items not available for OSC links #900

Open
xmo-odoo opened this issue Apr 16, 2024 · 4 comments
Open

Contextual menu items not available for OSC links #900

xmo-odoo opened this issue Apr 16, 2024 · 4 comments

Comments

@xmo-odoo
Copy link

Is your feature request related to a problem? Please describe.

According to the documentation, clickable items should support ctrl-click and add "open link" and "copy address" items to the contextual menu.

Terminal hyperlinks are supported by terminator and do generate what looks like clickable items (cursor changes to a hand, and ctrl-click works) however no additional item appears in the context menu.

Reproduction

Input

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

in Terminator, confirm, this should print the text "This is a link". Right-click the text, observe that the contextual menu is no different than outside the text.

Describe the solution you'd like
For the contextual items to be available.

Additional context
Terminator v 2.1.1 on Linux Mint.

The contextual menu items do appear in GNOME terminal.

I saw that #434 added support for direct opening (no need for control) in 2.1.2, but I didn't see anything else related to URLs, or other than #662 for context menu stuff.

@mattrose
Copy link
Member

What you're referring to is an OSC-8 hyperlink, and, last I checked, These were not supported by the underlying VTE lib, mainly for security (You can b tasically hide any link behind the text and it will open it). If it's supported by gnome-terminal, then they've either come up with their own OSC-8 patch or Christian has added support in VTE.

@egmontkob, you wouldn't happen to know if OSC-8 support has been added to VTE?

@mattrose
Copy link
Member

Did some more digging, and see that Egmont actually implemented OSC-8 support in VTE, so I can defilnitely pull that in to Terminator.

@egmontkob
Copy link

gnome-terminal/vte and iterm2 were the designers of and the first to support OSC 8 hyperlinks. (You might be mixing it up with OSC 52 copy-paste which we're refusing to implement due to notable security issues.)

See the Security section in its gist. Or the user comments if you're up to a lot of flaming. Basically these hyperlinks work exactly like on the web, and are subject to exactly the same problems (yes you can have a visual text that reads http://goodboy.net and points to http://evilguy.com instead, just like on the web -- the browser that opens it is supposed to warn if it's a malicious site; also the app (e.g. terminal-based email client) can do that upfront). The user is also supposed to exercise proper caution, e.g. not cat a file received from an untrusted source, then click on a link on it, and then enter the webbanking details. Essentially, again, the very same story as on the web, or with any hyperlink found in any other source (email, pdf, doc, qr code etc.).

It is highly recommended that the URL is shown to the user upfront, e.g. as a tooltip text, or whatever you feel is the best choice for Terminator's UI.

@egmontkob
Copy link

Terminator actually does support opening OSC 8 hyperlinks. This bugreport just expects the right-click menu to be populated with related entries, too; like in gnome-terminal. And I'm mentioning that a tooltip would be nice, too.

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

No branches or pull requests

3 participants