Mac: Running atom in Terminal opens $PATH


#1

Running atom FILE_NAME in Terminal will open two windows, one is the FILE_NAME, the other one is $PATH:

Atom

By removing --path-environment="$PATH" from /usr/local/bin/atom:L69 will resolve this issue.


#2

Have you followed the suggestions in the Debugging document? Also, could you give the following information?

  • Which version of Atom are you using?
  • What OS version are you running?
  • Can you reproduce the issue after completely exiting Atom and restarting using atom --safe FILE_NAME?

#3
  • 0.149
  • OX X 10.10.1
  • Still can reproduce this issue

I’ll try the suggestions later.


#4

Thanks, I’ll try to reproduce it later … or maybe @postcasio can get to it before I can?


#5

On Atom v0.149.0 on Mac OS X 10.10.1, I cannot reproduce this issue in either iTerm2 or Terminal. I even tried opening /usr/local/bin/atom like you did in your screenshot and still can’t reproduce what you’re seeing.


#6

I final found out why I got this issue: my $PATH contained a whitespace. After whitespace removed, atom FILE_NAME works as expected.

And I noticed that Atom will separate ARGV by whitespace to support opening multiple files, e.g. atom FILE_A FILE_B. But can’t understand why Atom will separate --path-environment.


#7

If you’re talking about this line here:

then there are a couple things that happen even before Atom gets involved, namely bash and the open command. You’d have to dig into how the arguments are getting parsed by those as well to figure out what is really going on.