Open Atom on specific file at a specific line


#1

How can one open the Atom from the command line at a particular line?

I’ve found only previous discussion and a couple of issues: this (#1743) and (#6640).

I’ve tried similar too (under Windows 8.1 and Atom 1.0.0):

> atom.cmd article.tex:22:10

But it opens the file article.tex:22:10 (obviously, that’s not the desired behaviour).


#2

Have you tried quoting it? atom.cmd "article.tex:22:10"


#3

Yes. Same as without quotes.


#4

Sounds like this is a Windows-specific issue. I just tried it on OS X and it works fine (except for the thing where there is already an Issue open). Would you mind opening a new Issue on atom/atom and posting a link to the Issue here?


#5

Ok. I’ll then opened an issue (#7709).

I just don’t have other environment, so I though it’s an Atom specific issue (and not a Windows only).


#6

I can confirm this behavior as well, Win8.1.
I’ve never tried it before, but yea… just seems to take the numbers as part of the filename’s extension and because of course it doesn’t exist, Atom opens a new file pane for it.


#7

This is not windows only… Happens for me as well on Debian Linux


#8

Well, there is a known cross-platform Issue with opening a file at a specific line here:

See my repro steps for details on exactly how that works. But it appeared that the issue on Windows is worse, which is why I asked @m0nhawk to file a new Issue. But I was wrong, this is a repro of the same issue :laughing:


#9

So while on OSX it works as long as you are inside the folder of the file in question, in Windows and Linux it won’t work at all.

If there are specs for this behavior (and I assume there are), they just haven’t been tested on anything but a Mac.
Makes me wonder if there is a way / an npm package or something, to emulate test responses from Node on other platforms.


#10

I thought the CI at least ran the specs on Linux, but in looking at the latest stuff from TravisCI, it would appear that at least the publicly run stuff doesn’t.


#11

I don’t know Travis very well. Is there privately run stuff?


#12

From what I understand there are CI builds run internally to GitHub for Atom (among many other projects, of course). They aren’t exposed externally, to my knowledge. Here’s what it looks like when they run: