Open File:# from iTerm


#1

When using Sublime Text I was able to Command+Click a file path in iTerm2 output and it would open ST3 with that file and highlight the line number.

Ex: ./spec/features/some_spec.rb:181

Is this possible to do with Atom?


#2

If you execute atom filename:line_number … yes, it will open that file and move the cursor to that line.


#3

I am currently using Run Command /usr/local/bin/atom -n \1:\2 in iTerm2

When I command click something like ./spec/features/some_spec.rb:181, instead of opening up some_spec.rb and jumping to line 181, it is opening file some_spec.rb: notice the colon in the file name.

So, it’s actually just loading up a blank file with that file name.

That Run Command was the same I had for Sublime Text, except instead of atom, I was using subl.

Any idea what I am doing incorrectly?


#4

In addition to that, I just tried to run the base command atom ./spec/features/some_spec.rb:271 as well as atom -n ./spec/features/some_spec.rb:271 and both of them actually open the correct file, but are still defaulted to line 1.

If it helps, I am on Atom v0.106.0


#5

To test this before I responded, I ran atom Gemfile:10 and it worked for me … so let me see if I can do some other tests to see what the issue might be.


#6

Funny enough. That worked for me as well…

I wonder if it has something to do with the path structure starting with ./?


#7

But atom -n ./app/assets/stylesheets/application.scss:25 works fine as well, so that’s not the case…

That’s really bizarre. Even Cmd+Clicking on that path after running it works as expected.

I’m not sure what the deal is… Seems to work for some things, but not others, and not sure how to fully recreate…


#8

There is definitely something fishy, because I’m getting spotty results with various things that have a directory structure in the path. Can you go ahead and file an issue on this?


#9

Filed at https://github.com/atom/atom/issues/2745

Thanks!