Issue changing focus to a fullscreen Atom instance on OSX


#1

Here’s my situation:

  • I’ve already got an Atom workspace open with the window in fullscreen mode.
  • I’ve got a terminal window that’s fullscreen.
  • From the terminal I want to open foo.txt in the existing atom window (assuming foo.txt is part of the already open workspace) and move the cursor to line 7, and I want to move focus to the newly opened file.
  • Running atom foo.txt:7 will open the file to the correct line, but will bring the desktop into focus rather than the Atom window.
  • Running open -a atom will open a new window or will correctly change focus to an existing window.
  • Running open -a atom foo.txt will open the file and correctly focus on the existing window, but open -a atom foo.txt:7 will fail because foo.txt:7 is not a file name.
  • Running open -a atom --args foo.txt:7 will work if an Atom window is not already open (it will open a new window with the file and go to the correct line), but if the workspace is already open it will behave the same as open -a atom (i.e. it will focus on the window but not open the file).
  • Running open -a atom -n --args foo.txt:7 behaves the same as atom foo.txt:7.

Currently my solution is to run atom foo.txt:7 to open the file and then immediately run open -a atom which brings focus to the Atom window. What I’d like is for atom foo.txt:7 to cause my computer to focus on the Atom instance where the file was opened. It’s already trying to do so because it removes focus from the terminal, but for whatever reason it changes focus to the desktop rather than the Atom window.

Does anyone know why this is happening? Is this an issue with Atom or iOS?

Thanks.


#2

I can replicate the problem you’re describing when both Atom and my terminal program are running in full screen, but not when the terminal program is not running full screen.

Please file an Issue on https://github.com/atom/atom with exact repro steps. (You can leave out all the stuff about open -a atom since it isn’t relevant.)


#3

Filed: https://github.com/atom/atom/issues/12073