Closed adnanademovic closed 7 years ago
What OS are you running on?
Linux
It tries to calculate the users real path by running https://github.com/bcomnes/sublime-standard-format/blob/master/StandardFormat.sublime-settings#L56 This isn't guaranteed to work on all systems, but in my tests works alright. Any ideas on how to improve that?
This behavior can also be disabled here: https://github.com/bcomnes/sublime-standard-format/blob/master/StandardFormat.sublime-settings#L53
The only problem is that it's changing the process' path variable. I assume you're doing that for the subprocess.
Python's subprocess.Popen
has an optional env
parameter. You can extend the existing environment if that is your desire, and it will work as if you modified the actual env. I just tested the following code with a dummy example.
myenv = dict(os.environ) # Shallow copy of environment
# either
myenv['PATH'] += ':' + your_extra_path_stuff
# or
myenv['PATH'] = your_extra_path_stuff
# (I'm half-asleep, so I'm having a hard time figuring out what your desired solution is)
# Then, whenever you call Popen
suprocess.Popen( <the args that you used>, env=myenv)
Gonna go to sleep now
I don't think I intended to modify the process env. I'll take a look.
I've made a fix that works nicely on my end
Path variable gets changed to "agent pid". Suffice to say, causes lots of things to fail outside the package, including other packages.
I assume it's standard-format.py#L123 that's the culprit here.