Live data from Hacker News

Hyperlinks in terminal emulators

gist.github.com

11–20 of 70 posts

Re: Hyperlinks in terminal emulators

#11
post #3

On my second day when I worked at Reddit, I learned by accident that I do not want my terminal to have clickable links. I was working on image compression, and we had a script where we would render a column with the original image link, and a column with the new compressed image, and a column with the relative percentage of size to PNG, and there would be like 200 rows at a time. I managed to somehow accidentally cli…

You probably could have just loudly explained to your reddit coworkers

Re: Hyperlinks in terminal emulators

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

What are you running in your terminal to be vulnerable to that threat model?

Re: Hyperlinks in terminal emulators

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

Re: Hyperlinks in terminal emulators

#15
post #13
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.

What are you running in your terminal to be vulnerable to that threat model?

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.

Re: Hyperlinks in terminal emulators

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

Disaster is perhaps an exaggeration, but it does seem like this would be another environment, where users need to be aware of a different set of safety and usability measures than in the browser. Surely we will see interesting attempts at exploiting it.

Overall, I think the idea is super interesting, especially the ability to encode in the future other context than URLs with it. Whether actually useful, or just gimmicky, remains to be seen.

Re: Hyperlinks in terminal emulators

#17

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)

Re: Hyperlinks in terminal emulators

#19
post #8
post #6

Earlier quoted context omitted.

In every implementation I've seen, the link only becomes clickable if you hold down a modifier key. By default, the links are just text. Which should make intuitive sense, because otherwise it'd be breaking existing semantics, as it would e.g. make it impossible to highlight the underlying text to copy-and-paste. (Or to send a click event to the underlying PTY-controlling process-group leader when mouse reporting is…

> the link only becomes clickable if you hold down a modifier key. Fun trick not a lot of people know - In a web browser, links which are normally clickable become UN-clickable if you hold a modifier. On a mac, it's (option). It's helpful if you want to select text inside a large link (or in a button) so you can copy it.

Thanks, I did not know! On Firefox/Linux, it's Alt and dragging the mouse through the part of the text you want.

Re: Hyperlinks in terminal emulators

#20
post #15
post #13

Earlier quoted context omitted.

What are you running in your terminal to be vulnerable to that threat model?

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.
Post reply on HN