logoalt Hacker News

Hyperlinks in Terminal Emulators

25 pointsby nvahaliktoday at 3:32 AM9 commentsview on HN

Comments

dust42today at 6:11 AM

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.
oldestofsportstoday at 6:55 AM

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

tomberttoday at 5:20 AM

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 click on a link in iTerm, my browser opened, and I discovered what "sounding" [1] is, on a company computer, in the company office.

I saw it, whispered "oh fuck!", and quickly killed my browser. I don't think anyone saw me but I was extremely worried that I was going to get fired on my second day of work for viewing porn on a company computer in front of everyone, even though it was a legitimate accident.

So now I don't want my links to be clickable. If there's a link I'll highlight it and paste it into Firefox manually.

[1] If you do not know what sounding is, I do not recommend you look it up, just know that it's a weird sex thing that I wish I didn't know about and cannot unsee.

show 4 replies
kristopoloustoday at 5:05 AM

tl;dr

here's coming from markdown

        LINK      = ["\033]8;;", "\033]8;;\033\\"]
        re.sub(r"\[([^\]]+)\]\(([^\)]+)\)", process_links, line)
        def process_links(match):
          description = match.group(1)
          url = match.group(2)
          return f'{LINK[0]}{url}\033\\{UNDERLINE[0]}{description}{UNDERLINE[1]}{LINK[1]}'