Why: The browser-launching logic (best-browser detection + backgrounded launch) was buried inside config-help --html and not reusable. This extracts it and builds a repo-browsing convenience on top.
What:
open-url — new function. Resolves the best graphical browser ($fish_help_browser → $BROWSER → xdg-mime https handler → known binaries → xdg-open) and launches it backgrounded. Silent by default (-v/--verbose reports the browser, -s/--silent accepted explicitly). Browser console chatter (e.g. "Opening in existing browser session.") is discarded.
repo-open — new function. Opens the current repo's origin remote in a browser via open-url. Normalizes HTTPS and SSH/scp remote forms, deep-links to the current branch (falling back to the remote default) and sub-directory. Provider layout resolved via git config browse.provider → hostname heuristic (github/gitlab/gitea/bitbucket, codeberg→gitea) → github default. -p/--print emits the URL; -r/--root ignores the sub-directory.
config-help — the inlined browser block (~65 lines) now just calls open-url.
Abbreviations — open-repo and url-open expand to the canonical command names on space/enter (visible hint, not a silent alias).
Docs — both functions documented in the SSoT (fish-config.md + .index); README doc-browsing table gains a repo-open row.
Note:.gitignore has an unrelated pending change deliberately excluded from this PR — it'll ship with the next PR that generates it dynamically.
browse.provider=gitea was set on this repo's local git config so git.rootiest.dev links resolve to /src/branch/… (that's local config, not part of this diff).
Manual Verification
repo-open --print prints https://git.rootiest.dev/rootiest/fish-config from the repo root.
cd docs; repo-open --print prints …/src/branch/main/docs (gitea layout, current sub-directory).
repo-open (no flags) opens the repo web page in your browser with no terminal output.
open-url https://example.com opens the page silently; open-url -v https://example.com prints an Opening <browser>… line.
help config --html still opens the local HTML docs in the browser (config-help extraction intact).
Type open-repo then press space — it expands to repo-open; same for url-open → open-url.
## Summary
**Why:** The browser-launching logic (best-browser detection + backgrounded launch) was buried inside `config-help --html` and not reusable. This extracts it and builds a repo-browsing convenience on top.
**What:**
- **`open-url`** — new function. Resolves the best graphical browser (`$fish_help_browser` → `$BROWSER` → `xdg-mime` https handler → known binaries → `xdg-open`) and launches it backgrounded. Silent by default (`-v/--verbose` reports the browser, `-s/--silent` accepted explicitly). Browser console chatter (e.g. "Opening in existing browser session.") is discarded.
- **`repo-open`** — new function. Opens the current repo's `origin` remote in a browser via `open-url`. Normalizes HTTPS and SSH/scp remote forms, deep-links to the current branch (falling back to the remote default) and sub-directory. Provider layout resolved via `git config browse.provider` → hostname heuristic (github/gitlab/gitea/bitbucket, codeberg→gitea) → github default. `-p/--print` emits the URL; `-r/--root` ignores the sub-directory.
- **`config-help`** — the inlined browser block (~65 lines) now just calls `open-url`.
- **Abbreviations** — `open-repo` and `url-open` expand to the canonical command names on space/enter (visible hint, not a silent alias).
- **Docs** — both functions documented in the SSoT (`fish-config.md` + `.index`); README doc-browsing table gains a `repo-open` row.
> **Note:** `.gitignore` has an unrelated pending change deliberately excluded from this PR — it'll ship with the next PR that generates it dynamically.
>
> `browse.provider=gitea` was set on this repo's local git config so `git.rootiest.dev` links resolve to `/src/branch/…` (that's local config, not part of this diff).
## Manual Verification
- [x] `repo-open --print` prints `https://git.rootiest.dev/rootiest/fish-config` from the repo root.
- [x] `cd docs; repo-open --print` prints `…/src/branch/main/docs` (gitea layout, current sub-directory).
- [x] `repo-open` (no flags) opens the repo web page in your browser with no terminal output.
- [x] `open-url https://example.com` opens the page silently; `open-url -v https://example.com` prints an `Opening <browser>…` line.
- [x] `help config --html` still opens the local HTML docs in the browser (config-help extraction intact).
- [x] Type `open-repo` then press space — it expands to `repo-open`; same for `url-open` → `open-url`.
Extract the browser-detection and launch logic out of config-help into a
reusable open-url function, then build repo-open on top of it to open the
current repo's origin remote in a browser.
- open-url: resolve the best graphical browser (fish_help_browser -> BROWSER
-> xdg-mime https handler -> known binaries -> xdg-open) and launch it
backgrounded. Silent by default; -v/--verbose reports the browser, -s/--silent
is accepted explicitly. Browser console chatter is discarded.
- repo-open: normalize the origin URL from HTTPS and SSH/scp forms, deep-link
to the current branch (falling back to the remote default) and sub-directory.
Provider layout resolved via git config browse.provider, hostname heuristic
(github/gitlab/gitea/bitbucket, codeberg->gitea), then github default.
-p/--print emits the URL, -r/--root ignores the sub-directory.
- config-help: replace the inlined browser block with an open-url call.
- abbr: add open-repo and url-open abbreviations that expand to the canonical
command names on space/enter.
- docs: document both functions in the SSoT (fish-config.md + index) and add a
repo-open row to the README doc-browsing table.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Why: The browser-launching logic (best-browser detection + backgrounded launch) was buried inside
config-help --htmland not reusable. This extracts it and builds a repo-browsing convenience on top.What:
open-url— new function. Resolves the best graphical browser ($fish_help_browser→$BROWSER→xdg-mimehttps handler → known binaries →xdg-open) and launches it backgrounded. Silent by default (-v/--verbosereports the browser,-s/--silentaccepted explicitly). Browser console chatter (e.g. "Opening in existing browser session.") is discarded.repo-open— new function. Opens the current repo'soriginremote in a browser viaopen-url. Normalizes HTTPS and SSH/scp remote forms, deep-links to the current branch (falling back to the remote default) and sub-directory. Provider layout resolved viagit config browse.provider→ hostname heuristic (github/gitlab/gitea/bitbucket, codeberg→gitea) → github default.-p/--printemits the URL;-r/--rootignores the sub-directory.config-help— the inlined browser block (~65 lines) now just callsopen-url.open-repoandurl-openexpand to the canonical command names on space/enter (visible hint, not a silent alias).fish-config.md+.index); README doc-browsing table gains arepo-openrow.Manual Verification
repo-open --printprintshttps://git.rootiest.dev/rootiest/fish-configfrom the repo root.cd docs; repo-open --printprints…/src/branch/main/docs(gitea layout, current sub-directory).repo-open(no flags) opens the repo web page in your browser with no terminal output.open-url https://example.comopens the page silently;open-url -v https://example.comprints anOpening <browser>…line.help config --htmlstill opens the local HTML docs in the browser (config-help extraction intact).open-repothen press space — it expands torepo-open; same forurl-open→open-url.