Live data from Hacker News

Hyperlinks in terminal emulators

gist.github.com

21–30 of 70 posts

Re: Hyperlinks in terminal emulators

#21
I have found this really useful together with file:// links. If properly set up, you can use this to go to a specific file, line and column in your IDE/editor even. Very useful with custom lint and debug tooling that I have written for my dayjob.

Re: Hyperlinks in terminal emulators

#22

I think CLI code agents (eg. Claude Code) should render the line numbers in their diff view as links, opening that line in your editor of choice. You can also make your own scheme-handler easily (on Linux at least). I have a `niri://` handler enabling linking to a specific Wayland window. (it has niche usecases :D) This guy build a pty "proxy" to linkify Claude Code output: https://www.youtube.com/watch?v=GP5TwKnCzhQ

> I think CLI code agents (eg. Claude Code) should render the line numbers in their diff view as links, opening that line in your editor of choice. CC already does this with PR/MR/etc links for example (i.e. #123 is clickable and brings you to issue 123 in the repo it's working on)

Yes, they do it with the paths inside the `Edit(path/to/file)` tool calls as well. But I have not seen any links using the capability to link to line numbers.

https://github.com/anthropics/claude-code/issues/13008

Re: Hyperlinks in terminal emulators

#23
I love these and wish they were used more by command line applications. For instance in GCC, when your terminal supports them, compiler diagnostic flags are clickable and something like "warning: address of local variable ‘a’ returned [-Wreturn-local-addr]" can be clicked to open the GCC documentation for that flag.

Re: Hyperlinks in terminal emulators

#24
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. With no hidden metadata, accidental clicks are less probable and social engineering attacks, such as UI deception, are impossible.

[1]: https://p9f.org/sys/doc/plumb.html

Re: Hyperlinks in terminal emulators

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

IMO Konsole does it right, it's a feature that's disabled by default, and there is an explicit warning next to the option to turn it on that says:

    WARNING: This has security implications as it allows malicious URLs
    to be shown as another URL or hidden.
    Make sure you understand the implications before turning this on.
Then it has an option for you to enter the link schemes you want to enable, like https://, file://, etc

Re: Hyperlinks in terminal emulators

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

[deleted]

Re: Hyperlinks in terminal emulators

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

Re: Hyperlinks in terminal emulators

#28
post #23

I love these and wish they were used more by command line applications. For instance in GCC, when your terminal supports them, compiler diagnostic flags are clickable and something like "warning: address of local variable ‘a’ returned [-Wreturn-local-addr]" can be clicked to open the GCC documentation for that flag.

This is a basic copy-paste and search function. I admit that your approach is fast but counter that it highlights a failure to make basic functions like copy-paste and search efficient and introduces a whole class of complexity into software design.

Edit: the same applies to diffs generated by /bin/diff. Most of the time, diff strings are unique enough to locate them by plain text searching.

Re: Hyperlinks in terminal emulators

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

And yet, it isn't always safe. Yes, that should be fixed, but defense in depth exists for a reason.
Post reply on HN