Skip to content

Custom Control Sequence - Open URL

Feature Request

Summary

Hi @gnachman, I'd like to request a new OSC 1337 control sequence to open a URL on the local machine. I'm aware of Anchor (OSC 8). The hypothetical new control code is different because it does not display a hyperlink; it directly opens the link using the appropriate system URL handler.

Use cases:

  • Starting a development server on a remote machine: http://localhost:8080/ (requires the appropriate port forward already set up).
  • Opening an IDE in a specific folder on a remote machine: vscodium://vscode-remote/ssh-remote+hostname/path/to/folder

Alternatives

It's certainly possible to use a Python script to accomplish this, and this is a good workaround for my own personal scripts. However, implementing it directly in iTerm 2 would allow adding the functionality to tools like webbrowser (Python), open (Node.JS), and xdg-open (UNIX).

Concerns

  • Privacy - probably needs to share the same level of controls as the clipboard access escape codes. Some browsers additionally confirm before opening a non-http URL.
  • Performance - N/A
  • Memory - N/A
  • Complexity - I believe pretty simple; the custom python script is quite simple for example
  • Is this an instance of a more general problem? - I think this is sufficiently general