I recently changed my default browser from Chrome to Safari, but I still do development in Chrome. I'd like URLs in iTerm2 to open up in Chrome, but now they open in Safari since its my system default.
Is it possible to change this?
I recently changed my default browser from Chrome to Safari, but I still do development in Chrome. I'd like URLs in iTerm2 to open up in Chrome, but now they open in Safari since its my system default.
Is it possible to change this?
You can add a Context Menu option for the smart selection of a URL for Chrome via the Edit Actions
of the Smart Selection Rules
(within a given profile) with a parameter of:
open -a "Google Chrome" \0
Once you do this, this action will override the built-in default of using the system defined app (Safari in your case).
If you are trying to open http://localhost:#PORT
, it might be necessary to add in Smart Selection Rules
a new rule with Regular Expression of https?://localhost(:[a-zA-Z0-9]+)?
and Precision of Very High
, before applying @SushiHangover's answer.
The default HTTP URL
rule does not appear to recognize http://localhost
well.
You should specify which browser you want to open that URL by, you can try the below command:
open -a "/Applications/Google Chrome.app" <your URL>