Sublime Forum

[SOLVED] ST2 does not respect system PATH in OSX (10.8)

#1

I noticed that when I installed the git plugin it wasn’t using the right version (the version in /usr/local/bin) since it was missing some features.

in the ST2 python console I ran

>>> os.system("echo $PATH > temp.txt")

and the reslt in temp.txt was

/usr/bin:/bin:/usr/sbin:/sbin

On the other hand, in my terminal:

derek@derek-MBA:~% echo $PATH [15:06] /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/X11/bin derek@derek-MBA:~% cat /etc/paths [15:06] /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin derek@derek-MBA:~% [15:06]

As I understand it the path env variable is based off the /etc/paths file and ofc can be modified like any other env var, but ST2 doesn’t appear to use it.
I also ran “which git” inside the ST2 console and got “/usr/bin/git” while in a terminal I get “/usr/local/bin/git”, as I hoped for.

This seems like a bug, but is there any temporary fix, such as putting the correct path into the settings file somehow?

Thanks,
Derek

0 Likes

#2

I would also like an answer for this. I am on OS X 10.7.4 and get the same issues.

0 Likes

#3

I don’t use OSX so I’m not sure if this is useful help, but this problem sounds similar to this one:

docs.sublimetext.info/en/latest/ … ld-systems

0 Likes

#4

If you read through stackoverflow.com/questions/6037 … 08#4567308 has an answer about how to set environmental variables that will be picked up by things like Sublime Text.

0 Likes

#5

Huh, ok. Didn’t know that, weird that OSX doesn’t use /etc/paths for GUI apps.

That is the problem though I guess, thanks!

0 Likes