Gitpro.Browser (gitpro v0.1.0)

Copy Markdown View Source

Opens a URL in whatever this desktop calls a browser.

$BROWSER first, because someone who set it meant it, then xdg-open, then the macOS open — the first one that exists on the PATH wins.

The command is run detached from the terminal, with its output on /dev/null: a browser that decides to log a GTK warning would otherwise write it straight over the frame the UI has drawn, on a terminal that is in raw mode and will not scroll it away.

Summary

Functions

Opens url, answering :ok or {:error, message}.

Functions

open(url)

@spec open(String.t()) :: :ok | {:error, String.t()}

Opens url, answering :ok or {:error, message}.

It blocks until the opener returns, which is quick but not instant — call it from an Atui.Fetch, not from a view callback.