randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.39k stars 81 forks source link

DYLD_LIBRARY_PATH environment variable will not load #247

Open ausiddiqui opened 3 years ago

ausiddiqui commented 3 years ago

My .sublime-build file looks like this:

{
    "target": "terminus_open",

    "auto_close": false,
    "title": "Python 3.6",
    "timeit": true,
    "post_window_hooks": [
        ["carry_file_to_pane", {"direction": "right"}]
    ],

    "shell_cmd": "/Users/ash/miniconda3/envs/py36/bin/python -u \"$file\"",
    "file_regex": "^[]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",

    "env": {"PYTHONIOENCODING": "utf-8"},

    "variants":
    [
        {
            "name": "Syntax Check",
            "shell_cmd": "/Users/ash/miniconda3/envs/py36/bin/python -m py_compile \"${file}\"",
        }
    ]

}
import os
print(os.getenv('DYLD_LIBRARY_PATH'))

Returns None. This is on macOS 10.15.7. I have a conda environment running but I load Sublime by running inside the conda environment and opening it from a regular terminal window. I have tested loading variables declared before and after my DYLD_LIBRARY_PATH definition from my .zshrc file, all of them print perfectly except for this.

randy3k commented 3 years ago

It is because shell_cmd invokes the bash shell instead of zsh. You could use cmd instead. Something like "cmd": ["zsh", "-lc", "YOUR COMMAND"]