Skip to content

feat(config): add window.url_opener#71

Open
roramirez wants to merge 1 commit into
mainfrom
feat/config-url-opener
Open

feat(config): add window.url_opener#71
roramirez wants to merge 1 commit into
mainfrom
feat/config-url-opener

Conversation

@roramirez

Copy link
Copy Markdown
Owner

Summary

Adds a window.url_opener configuration option so users can override the command used to open URLs on click. Previously the opener was hardcoded per-OS (xdg-open on Linux, open on macOS, cmd /c start on Windows). An empty string (the default) preserves the existing per-OS behavior.

Changes

  • src/config/mod.rs: add url_opener: String (#[serde(default)]) to WindowConfig.
  • src/input/mouse_ops.rs: open_url now takes an opener argument; if non-empty it spawns <opener> <url>, otherwise falls back to the per-OS branches. Caller passes config.window.url_opener.
  • src/config/tui_config.rs: new URL Opener field (F_URL_OPENER) in the config panel, wired through from_config and build_config.
  • assets/config.toml, README.md, doc/SPEC.md, CHANGELOG.md: documented the new option.
  • Tests: updated field-count/round-trip/index-sanity asserts; added round-trip tests for url_opener in config_test.rs and tui_config_test.rs.

How to test

  • cargo test — all 1221 tests pass (includes new url_opener round-trip tests).
  • cargo clippy --locked -- -D warnings — clean.
  • Manual: set url_opener = "firefox" under [window] in the config, click a link in the terminal, and confirm Firefox opens it. Leave it empty to confirm the system default still works.

Add an optional window.url_opener config field. When non-empty, clicking
a URL runs the configured command with the URL as its argument; an empty
string (the default) keeps the per-OS behaviour (xdg-open/open/cmd start).
Exposed in the TUI config panel as "URL Opener".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant