{"action":"created","issue":{"url":"https://api.github.com/repos/atom/atom/issues/9526","labels_url":"https://api.github.com/repos/atom/atom/issues/9526/labels{/name}","comments_url":"https://api.github.com/repos/atom/atom/issues/9526/comments","events_url":"https://api.github.com/repos/atom/atom/issues/9526/events","html_url":"https://github.com/atom/atom/issues/9526","id":116314382,"number":9526,"title":"Files don't open in initial window on OS X","user":{"login":"palant","id":374261,"avatar_url":"https://avatars.githubusercontent.com/u/374261?v=3","gravatar_id":"","url":"https://api.github.com/users/palant","html_url":"https://github.com/palant","followers_url":"https://api.github.com/users/palant/followers","following_url":"https://api.github.com/users/palant/following{/other_user}","gists_url":"https://api.github.com/users/palant/gists{/gist_id}","starred_url":"https://api.github.com/users/palant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palant/subscriptions","organizations_url":"https://api.github.com/users/palant/orgs","repos_url":"https://api.github.com/users/palant/repos","events_url":"https://api.github.com/users/palant/events{/privacy}","received_events_url":"https://api.github.com/users/palant/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-11T11:29:18Z","updated_at":"2015-11-11T12:47:00Z","closed_at":null,"body":"I am using Atom 1.2.0-beta2 on OS X 10.10. I open files like that:\r\n\r\n    open -a \"Atom Beta\" foo.js\r\n\r\nIf Atom isn't running yet then `foo.js` will be opened in the initial window. Opening another file after that will create a second application window, additional files will be added as tabs to that window. I would expect these files to be added to the initial window.\r\n\r\nOriginally I thought that the initial window is opened in dev mode because Cmd+Alt+I shortcut works there. However, `node-inspector` shows `window.devMode === false` for the initial window and `window.devMode === undefined` for the second one."},"comment":{"url":"https://api.github.com/repos/atom/atom/issues/comments/155768149","html_url":"https://github.com/atom/atom/issues/9526#issuecomment-155768149","issue_url":"https://api.github.com/repos/atom/atom/issues/9526","id":155768149,"user":{"login":"palant","id":374261,"avatar_url":"https://avatars.githubusercontent.com/u/374261?v=3","gravatar_id":"","url":"https://api.github.com/users/palant","html_url":"https://github.com/palant","followers_url":"https://api.github.com/users/palant/followers","following_url":"https://api.github.com/users/palant/following{/other_user}","gists_url":"https://api.github.com/users/palant/gists{/gist_id}","starred_url":"https://api.github.com/users/palant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palant/subscriptions","organizations_url":"https://api.github.com/users/palant/orgs","repos_url":"https://api.github.com/users/palant/repos","events_url":"https://api.github.com/users/palant/events{/privacy}","received_events_url":"https://api.github.com/users/palant/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T12:47:00Z","updated_at":"2015-11-11T12:47:00Z","body":"This seems to be caused by the strict comparison for the `window.devMode` flag. For externally opened files `openPath` function will be [called with `devMode === undefined`](https://github.com/atom/atom/blob/ff812749e67ed55518f91fa9d56286f8f3ce4ed6/src/browser/atom-application.coffee#L224). But this makes the comparison in [function `windowForPath`](https://github.com/atom/atom/blob/ff812749e67ed55518f91fa9d56286f8f3ce4ed6/src/browser/atom-application.coffee#L341) fail (`false !== undefined`) so that the existing window is considered unsuitable for the file. Adding something like this to `openPaths` function should do:    \r\n\r\n    devMode = if devMode then true else false"}}