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.txtin the existing atom window (assuming
foo.txtis part of the already open workspace) and move the cursor to line 7, and I want to move focus to the newly opened file.
atom foo.txt:7will open the file to the correct line, but will bring the desktop into focus rather than the Atom window.
open -a atomwill open a new window or will correctly change focus to an existing window.
open -a atom foo.txtwill open the file and correctly focus on the existing window, but
open -a atom foo.txt:7will fail because
foo.txt:7is not a file name.
open -a atom --args foo.txt:7will 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).
open -a atom -n --args foo.txt:7behaves the same as
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?