Live data from Hacker News

Hyperlinks in terminal emulators

gist.github.com

61–70 of 70 posts

Re: Hyperlinks in terminal emulators

#61
post #48
post #27

I've found it nice to have the terminal emulator be able to match text with regexp and upon a click convert it to an external action. For example, I can click Python traceback in terminal and have Emacs go into that exact line in code, or the JIRA issue id and go to the web page. I wonder though if this is a popular feature. Tilix is under minimal maintenance at the moment, so alternatives would be good to have..

Regarding the jira link example, are you using hyperbole buttons for this, or some other way? I’d like to do it without using hyperbole, it’s a nice package and all but the ‘buttons’ are the only (of the many) feature(s) I would use from it

If you're in emacs, you can use `bug-reference-mode`

https://www.gnu.org/software//emacs/manual/html_node/emacs/B...

As for the python backtrace, what you need is to set `compilation-error-regexp-alist` and use `compilation-minor-mode`.

https://www.gnu.org/software//emacs/manual/html_node/emacs/C...

Re: Hyperlinks in terminal emulators

#62

So, the approach is identical to example . In contrast, in Plumber [1], we have things like !98—this text opens pull request no. 98 by passing "!98" to the local server, which knows how to interpret it. Both approaches go one step beyond plain text. However, Plumber’s approach, at least, doesn’t compromise the plain text itself by embedding invisible elements. This eliminates an entire category of risks by design. Wi…

What is the reference to Plan9 here?

!x has been a shell history expansion since at least csh (1978?).

Re: Hyperlinks in terminal emulators

#63
post #15

Earlier quoted context omitted.

Trivially, `less` to see README.md of a malicious/compromised open source project. There are perhaps more plausible avenues of exploiting, but this one popped to mind immediately.

Opening a URL should always be safe. It's a security bug if it isn't.

Not true. At the very least it can leak your IP address. There's a reason whatsapp & other messaging services have an internal proxy for generating web previews.

Re: Hyperlinks in terminal emulators

#64
post #48

Earlier quoted context omitted.

Regarding the jira link example, are you using hyperbole buttons for this, or some other way? I’d like to do it without using hyperbole, it’s a nice package and all but the ‘buttons’ are the only (of the many) feature(s) I would use from it

If you're in emacs, you can use `bug-reference-mode` https://www.gnu.org/software//emacs/manual/html_node/emacs/B... As for the python backtrace, what you need is to set `compilation-error-regexp-alist` and use `compilation-minor-mode`. https://www.gnu.org/software//emacs/manual/html_node/emacs/C...

Wow, thank you, that’ll work perfectly! Of course bug reference mode is built-in, I had no clue (I need to stop being surprised by emacs’ built-in functionalities)

Re: Hyperlinks in terminal emulators

#65
post #10

I really think this is a security disaster waiting to happen, landing right in time for all the agentic terminal apps: printf '\e]8;;http://evil.com\e\\https://good.com\e]8;;\e\\\n' The next step would be to embedd a full javascript VM in the terminal and a CSS engine.

Seems like terminals should highlight in red and not link mismatches.

Re: Hyperlinks in terminal emulators

#66

Earlier quoted context omitted.

Isn't this like any other hyperlink? https://good.com

In a terminal I'd intuitively expect displayed text to not lie, especially if clicking it has consequences. The use-cases provided seem to all just be more or less "it's convenient and looks good", which is the last thing I care about in a situation like that.

ok fair point

Re: Hyperlinks in terminal emulators

#67

Earlier quoted context omitted.

Isn't this like any other hyperlink? https://good.com

In a terminal I'd intuitively expect displayed text to not lie, especially if clicking it has consequences. The use-cases provided seem to all just be more or less "it's convenient and looks good", which is the last thing I care about in a situation like that.

That's probably not a good intuition to have for a display rendered from ANSI escape sequences. Maybe not even from text rendered from unicode.

Though a good terminal should let you control whether you want to render the anchor text, show you the underlying link when you focus/hover/click it, etc.

Re: Hyperlinks in terminal emulators

#68
post #15

Earlier quoted context omitted.

Trivially, `less` to see README.md of a malicious/compromised open source project. There are perhaps more plausible avenues of exploiting, but this one popped to mind immediately.

Opening a URL should always be safe. It's a security bug if it isn't.

That's not the only URL-related attack surface.

e.g. "Log in to receive your bitcoin: https://colnbase.com" (phishing)

Re: Hyperlinks in terminal emulators

#69

Earlier quoted context omitted.

Isn't this like any other hyperlink? https://good.com

with the web browser you see a preview of the link ! not with most terminal i have tested

Alacritty shows a preview at the bottom by default (sounds similar to ghostty). Looked to me like WezTerm doesn't though.

Re: Hyperlinks in terminal emulators

#70
post #36

Browsers are great at hyperlinks, like really great. How about using browsers for hyperlinks instead?

You never opened a README.md that contained links in something else than a browser?

That's for the editor to handle, not the terminal.
Post reply on HN