How can I make OSX remember the desktop assignment of different chrome windows

14

3

Problem: When using google chrome browser (51.0.2704.103) on OSX (10.11.6) I often find myself losing my carefully ordered window placement between my many desktops. This happens if chrome happens to quit, or whenever OSX restarts. OSX tends to remember desktop allocation per application, but all chrome windows get bundled in the same desktop whenever chrome restarts.

Motivation: This is crucial to me because I alternate different projects and for productivity reasons I have each project on a different desktop.

Mick Halsband

Posted 2016-08-09T12:31:46.320

Reputation: 531

Can't be done. It will always return all windows to the same Space at relaunch. 'Fix' would be to use a different browser for each use case. – Tetsujin – 2016-08-09T12:47:55.767

@Tetsujin, could you elaborate on why you think this can't be done? Could a chrome extension handle this? Or an OSX native app? – Mick Halsband – 2016-08-10T14:14:28.980

Spaces simply wants all one app's windows in one Space. I've not seen anything that can break that habit, short of manually hauling them around every time. I organise my workflow to avoid it for that very reason. There may be a 3rd party app, but I don't know of one. – Tetsujin – 2016-08-10T15:35:37.397

1

Possibly, there is a way. Using a combination of http://apple.stackexchange.com/questions/191845/open-application-in-specific-space-through-applescript and native application creator. Google for nativefier or chromium webapp runtime.

– theoden8 – 2016-08-19T00:29:28.720

@Tetsujin iTerm restores windows to correct spaces not mentioning Apple own apps – alexeit – 2018-01-15T20:56:04.850

iTerm2 is the only app I found that actually remember which desktop its windows were on when you reopen it – Anentropic – 2018-10-05T11:07:43.987

Answers

10

Edit: This still doesn't COMPLETELY work for me as well: some windows are restored and some are not. The new bug id is 1012034.


This is being fixed in the latest development version (Chrome 79) as bug #74812.

Though, by default, in compliance with Apple's UI requirements, this feature still won't restore the workspaces if you exited Chrome with Cmd-Q. Quoting sdy, the feature author:

For folks who want Chrome to always restore windows to their original spaces, you can set that by running this command in a terminal window (for Canary, use com.google.Chrome.canary):

defaults write com.google.Chrome NSWindowRestoresWorkspaceAtLaunch -bool YES

To go back to the default behavior, run:

defaults delete com.google.Chrome NSWindowRestoresWorkspaceAtLaunch

Victor Sergienko

Posted 2016-08-09T12:31:46.320

Reputation: 536

Just tried this on Chrome 79.0.3945.130 official, macOS 10.14.6, and it didn't work at all. Don't think it's ready. – Robert Andrews – 2020-01-28T22:54:58.030

4

It seems like OSX will open all the windows of an application in the same desktop space. You will therefore need to open each window as a separate application instance.

For most applications, but not for Chrome, it is enough to open it via open -naF "App Name", but for Chrome you must also specify a different --user-data-dir parameter for each instance. You will need as many temporary directories as the number of instances that you wish to open.

References :

harrymc

Posted 2016-08-09T12:31:46.320

Reputation: 306 093

1

I came to this issue as well, this is how I tried to solve this.

  1. Right click chrome->options->Assign To (choose none).As shown in the picture down below

snapshot1-chrome

  1. Now you could click the chrome window to another desktop.Then you will see chrome in the second desktop.

snapshot2-desktop

pigfly

Posted 2016-08-09T12:31:46.320

Reputation: 111

1This to my understanding assigns the Chrome application to a desktop (with all it's windows) rather than a single Chrome window. – Mick Halsband – 2017-04-24T12:33:52.410

Excellent, exactly what I was looking for! – GhostCat salutes Monica C. – 2019-02-06T13:32:13.720