Starting Brackets from the Mac terminal command line

With the imminent release of Brackets 1.3 we now have the much-needed ability to easily start the editor from the terminal.

 
Setup of the command line shortcut takes just a couple of minutes:


1. Install Brackets 1.3

The latest version should be released for automatic update in a few days but if you can’t wait you can download the pre-release version right now from the Brackets GitHub repository.


2. Install the Command Line Shortcut

Start up Brackets then select the File… Install Command Line Shortcut menu item which now appears at the very bottom of the File menu.

Install the Command Line Shortcut

You’ll be asked to confirm your password, then the shortcut will be installed.

If everything went smoothly you’ll see a confirmation message and Brackets will be ready to use from within terminal:

Brackets Command Line tool installed

Notice that you can open a single file or switch projects.


3. Start Brackets from within terminal

brackets_zsh

As is common with other GUI apps started from the terminal there is one peculiarity:

  • If Brackets is closed, it will be started, the file (or project) to be edited will be loaded and the app brought to the front
  • If Brackets is open but not on top (or in another space), the file (or project) to be edited will be loaded and the app brought to the front
  • If Brackets is minimised, the file (or project) to be edited will be loaded but the app will not be brought to the front. This can be confusing if you haven’t seen this behaviour before because it appears that nothing at all has happened.

More info about Brackets 1.3 can be found in the release notes on GitHub.
Command line startup can also be set up on Windows; brief details are in the release notes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s