feat(config): add window.url_opener#71
Open
roramirez wants to merge 1 commit into
Open
Conversation
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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
window.url_openerconfiguration option so users can override the command used to open URLs on click. Previously the opener was hardcoded per-OS (xdg-openon Linux,openon macOS,cmd /c starton Windows). An empty string (the default) preserves the existing per-OS behavior.Changes
src/config/mod.rs: addurl_opener: String(#[serde(default)]) toWindowConfig.src/input/mouse_ops.rs:open_urlnow takes anopenerargument; if non-empty it spawns<opener> <url>, otherwise falls back to the per-OS branches. Caller passesconfig.window.url_opener.src/config/tui_config.rs: newURL Openerfield (F_URL_OPENER) in the config panel, wired throughfrom_configandbuild_config.assets/config.toml,README.md,doc/SPEC.md,CHANGELOG.md: documented the new option.url_openerinconfig_test.rsandtui_config_test.rs.How to test
cargo test— all 1221 tests pass (includes newurl_openerround-trip tests).cargo clippy --locked -- -D warnings— clean.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.