Open a URI in the user's chosen application from Zig: the desktop portal on Linux, ShellExecuteExW on Windows, Launch Services on macOS.
zig-openuri GLOSSARY.md
1.3 kB · 41 lines
Markdown
at main

openuri #

Handing a URI to the operating system so that the user's chosen application opens it, the way clicking a link in a document would.

Language #

URI: The text the caller asks to have opened, beginning with a scheme such as https: or mailto:. Avoid: URL, link, address

Handler: The application the operating system or the user picks to open a URI — a browser for https:, a mail client for mailto:. Avoid: browser, default app, opener

Open request: One call asking the operating system to hand a URI to its handler. Avoid: launch, open call

Outcome: What an open request ended in: the URI was opened by a handler, or the user cancelled the choice of handler. Avoid: response, status

Portal: The desktop service on Linux (xdg-desktop-portal) that receives open requests on an application's behalf and decides on the handler, asking the user when it has to. Avoid: desktop service, xdg

Parent window: The caller's own window, named so that any dialog the portal shows is placed over it. Avoid: owner window, transient parent

Activation token: A token from the caller's windowing system that lets the handler's window take focus rather than open behind the caller. Avoid: startup id, focus token