feat: add URL-based browser configuration#230
Open
vinceyyy wants to merge 2 commits intopaulirish:masterfrom
Open
feat: add URL-based browser configuration#230vinceyyy wants to merge 2 commits intopaulirish:masterfrom
vinceyyy wants to merge 2 commits intopaulirish:masterfrom
Conversation
Allow configuring which browser to use via git config, with URL-specific matching. This enables opening different repos in different browsers (e.g., work repos in Edge, personal in Safari). Usage: git config --global open.browser "open -a Safari" git config --global "open.https://github.com/org.browser" "open -a 'Microsoft Edge'" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Browser commands like `open -a 'Microsoft Edge'` need eval so quotes inside the variable are interpreted as shell syntax, not literal characters. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Fixes #229
Summary
open.browserandopen.<url>.browsergit config support, allowing different browsers for different URL patterns (e.g., Edge for work repos, Safari for personal)evalfor the browser command to properly handle quoted arguments likeopen -a 'Microsoft Edge'getConfig/--get-urlmatchmechanism — only 3 lines added to the scriptExample URLs being parsed
Test plan
open.browserconfigopen.<url>.browserconfig'Microsoft Edge')BROWSERenv var still takes priority over all config