Moving from Linux (OpenBox WM) to MBP, I'm struggling to recover the level of productivity I was used to... One specific thing that's killing it is OSX's insistence on separating between "applications" and "windows", assigning different key combos to toggling among either, each with its own rotation behavior (sigh). This gets even worse because OSX insists on bringing all the windows of application X to the front whenever I switch to it. I often run into situations where I have two or more Chrome windows and two or more Terminal windows, each group spanning the entire desktop space, but I cannot have one of each at the front at the same time.

Other constraints: I do not want to move windows to separate workspaces (or whatever that's called) just so I can work with them. I prefer not to use the mouse, but willing to do so if that'll solve my problem (it won't in the above case).

One thing that might solve my problem is being able to start new windows of the applications I care about (Chrome, Terminal) as separate instances. This will let me switch between them arbitrarily without forcing them all to the front.

Does anyone know of a way to do that in Yosemite? Much thanks!

  • 1
    To be honest, switch back to Linux :-) I've had the same issues as you for months and haven't been able to solve it either. Did you manage finally? – flindeberg Oct 21 '16 at 9:26

You can try the following syntax using open command:

open -na "Google Chrome"

where -n parameters opens a new instance even if one is already running.

Adding extra --user-data-dir will start instance in the separate profile directory, e.g.

open -na "Google Chrome" --args --user-data-dir="$PWD/Foo"

And using --profile-directory you can change the default profile name.

  • This definitely opens a new window but I can't tell how it's a new instance. I was expecting there to be multiple Chrome icons in in the task switcher. I ended up find an app to do something similar to this: bahoom.com/hyperswitch – kraftydevil Feb 28 '17 at 17:12
  • I'm not sure why your system doesn't show a new instance. When I begin a new instance with open -n of Safari or Forklift (as examples), they show up in the Dock and app switcher as new versions (as well as in Activity Monitor). If you're looking for an alternate app switcher, Witch by Many Tricks might be what you want. It allows switching by app as well as by window. – Dustin Wheeler Mar 23 '17 at 13:36
  • 2
    Ahh, this seems to be something different related to Chrome… multiple apps on my system (iTerm, Safari, Forklift) begin new instances, but Chrome seems to swallow the new instance (Activity Monitor shows a new instance when the open command is run, then it quickly disappears and the new window becomes a subprocess of the original Chrome instance). – Dustin Wheeler Mar 27 '17 at 14:01

Ok, a complete answer for the general case and for Chrome specifically:

For most applications, launching with open -naF "App Name" or open -nF /path/to/application.app should be sufficient (see Safari, Forklift, Office apps, etc.).

  • -n opens a new instance
  • -a tells open to look in the list of registered apps (no need to specify the full path, but can go wrong if you have multiple versions of an app. I sometimes see issues on my system with differentiating between macOS apps and apps installed by Parallels OSes… I prefer to specify the path directly.)
  • -F opens a fresh instance (ignores an app save state left over from previous instances)

For Google Chrome, something slightly different is required (modified from source in this blog post). Chrome must be launched from the command line with the --user-data-dir=/tmp/dir flag set in "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" (specify your own directory… if you only need two instances, probably best to make a permanent second home, but if you need an arbitrary number, best to create a shell function that creates a random temp directory then deletes it on quit).

Using this method results in multiple Chrome instances on my machine and prevents Chrome from consolidating them under the same master process.

By the way, you may want to incorporate additional flags in your shell function for launching Chrome… an extensive (automatically updated) list is available here.

Simplest method is the open -n command

e.g. open -n /Applications/Chrome.app/

  • Thanks. This did not have the expected effect unfortunately... With Chrome, it opened a new window indeed, but it was tied to the already running instance. With Terminal, it created a new instance that replicated the windows of the running instance (in a very freakish way). Not sure how to proceed here, further advice appreciated. – garnold Mar 9 '16 at 22:26
  • Not really sure after that, sorry. I just use Spaces & flip between working setups, depending on what I'm doing. – Tetsujin Mar 10 '16 at 7:08
  • The replication behavior is likely tied to the Resume feature that was introduced in OS X 10.7. You can disable it on a per-app basis using the defaults write command, or you can use the -F flag with open (e.g., open -nFa "Terminal") to open a "fresh" instance of an app (check the man page for open). – Dustin Wheeler Mar 27 '17 at 13:59

You'll (eventually) have to end up executing the application from Terminal.

You can either use the open -n command from Terminal (as mentioned by @Tetsujin) or you can within the application package click on the executable (usually in Application/Contents/MacOS/)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.