Sublime Forum

OS X: How to properly set paths for Sublime Text

#1

When starting ST3, if I start it using the subl command (which runs the 120KB executable subl copied from Contents/SharedSupport/bin/ from the app) it appears to gain my zsh shell path along with the addition of “:$HOME/bin”. Which is fine.

[code]

import os;
print(os.environ)
environ({‘LC_CTYPE’: ‘en_US.UTF-8’, ‘COMMAND_MODE’: ‘unix2003’, ‘LANG’: ‘en_US.UTF-8’, ‘SHLVL’: ‘1’, ‘TERM_PROGRAM’: ‘iTerm.app’, ‘TERM’: ‘xterm-256color’, ‘OLDPWD’: ‘/Users/lust’, ‘ITERM_SESSION_ID’: ‘w1t0p0’, ‘PWD’: ‘/Users/lust’, ‘PATH’: ‘/Users/lust/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/share/python:/usr/local/share/npm/bin:/usr/local/share/python:$HOME/bin’, ‘LESS’: ‘-R’, ‘HOME’: ‘/Users/lust’, ‘TMPDIR’: ‘/var/folders/z_/ybb_x1f96l9d2yqr18ncmg1w0000gn/T/’, ‘PAGER’: ‘less’, ‘Apple_Ubiquity_Message’: ‘/tmp/launch-eiM9HK/Apple_Ubiquity_Message’, ‘SHELL’: ‘/usr/local/bin/zsh’, ‘GREP_COLOR’: ‘1;32’, ‘Apple_PubSub_Socket_Render’: ‘/tmp/launch-Pj2h5n/Render’, ‘_’: ‘/Users/lust/bin/subl’, ‘__CF_USER_TEXT_ENCODING’: ‘0x1F5:0:0’, ‘SSH_AUTH_SOCK’: ‘/tmp/launch-auQ5hh/Listeners’, ‘LOGNAME’: ‘lust’, ‘GREP_OPTIONS’: ‘–color=auto’, ‘LSCOLORS’: ‘Gxfxcxdxbxegedabagacad’, ‘USER’: ‘lust’, ‘ITERM_PROFILE’: ‘Default’})[/code]

However when starting the app normally, from any number of places such as the spotlight menu usually, it only gets the path that you see here:

[code]

import os;
print(os.environ)
environ({‘LOGNAME’: ‘lust’, ‘PATH’: ‘/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/bin’, ‘Apple_Ubiquity_Message’: ‘/tmp/launch-eiM9HK/Apple_Ubiquity_Message’, ‘SSH_AUTH_SOCK’: ‘/tmp/launch-auQ5hh/Listeners’, ‘COMMAND_MODE’: ‘unix2003’, ‘SHELL’: ‘/usr/local/bin/zsh’, ‘_CF_USER_TEXT_ENCODING’: ‘0x1F5:0:0’, ‘TMPDIR’: '/var/folders/z/ybb_x1f96l9d2yqr18ncmg1w0000gn/T/’, ‘Apple_PubSub_Socket_Render’: ‘/tmp/launch-Pj2h5n/Render’, ‘HOME’: ‘/Users/lust’, ‘USER’: ‘lust’})[/code]

Now you will notice in one of these situations the path contains /usr/local/share/python which is where flake8 the python linter lives. So python will only get properly linted by SublimeLinter plugin when running it in that specific way.

As a matter of fact I even have the path to the python pip plugins inserted into /private/etc/paths, which is mirrored by /etc/paths, this means it should end up in the path no matter what.

I’d like to know how I can fix this issue with the path when starting the app normally. Didn’t find anything in the plist. As far as I can tell that is the only difference between the environments that is having an impact on functionality.

0 Likes