til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Set Default Browser From the Command Line

This can be done using the tool: defaultbrowser

Works like a charm.

With no arguments lists your browsers and marks the one being the default.

$ defaultbrowser
  iterm2
* chrome
  firefoxdeveloperedition
  safari
  vlc
  evernote
  netnewswire

Setting it is simply by providing an argument, matching the list

$ defaultbrowser chrome

Do note that this displays a GUI dialog,

GUI dialog

Currently there is no fix for this minor inexpediency, the dialog can be expedited with a swift (tab) followed by a (space).

:warning: this keyboard navigation seems to have been disabled in newer updates to MacOS :unamused:

References