Atom command line: focus Atom window (on Windows)


#1

Hi all! I’m the author of the LaTexTools plugin for Sublime Text, and am trying to port it to Atom. One bit of functionality I need for this is the ability to invoke Atom with a given file name and line number, and always gain focus.

So far, on Windows 10, running Atom 1.3.2, what I see is the following:

  • I open a command prompt on Windows and type atom file.tex:12, where file.tex is a file I want to edit: then, atom fires up and gains focus. The cursor jumps to line 12, as expected.
  • Next, I bring the Windows console to the foreground and issue the command atom file.tex:42. The problem is that the Atom windows stays in the background. The cursor jumps to line 42, again as expected.

I need the Atom window to gain focus. The -f option doesn’t do the trick. The only difference I see is that, without -f, when I launch Atom from the command line the prompt comes back immediately; with the -f option, it doesn’t come back untiil I quit Atom.

Any ideas?

PS: I do know that there are a couple of other LaTeX plugins for Atom. However, I’d like to see if I can port the entire LaTeXTools package, which has accumuulated a lot of functionality over the years (for instance, parsing log files, handling references and citations, cwl files, etc.)


#2

This is a known issue, tracked here:


#3

Great, thanks for pointing this out. I thought I was doing something wrong.