Sublime Forum

How to set the path of an executable

#1

I have a command set up like this:

{
        "caption": "Terminus: Open Julia Nightly",
        "command": "terminus_open",
        "args"   : {
            "cmd": ["c:/Users/PKrysl/AppData/Local/Programs/Julia/Julia-1.4.0-DEV/bin/julia.exe"],
            "cwd": "${file_path:${folder}}",
            "title": "Julia REPL",
            "env": {"JULIA_NUM_THREADS":"2"},
        }
    }

Would it be possible to use a ~ in the path? Like this?

{
        "caption": "Terminus: Open Julia Nightly",
        "command": "terminus_open",
        "args"   : {
            "cmd": ["~/AppData/Local/Programs/Julia/Julia-1.4.0-DEV/bin/julia.exe"],
            "cwd": "${file_path:${folder}}",
            "title": "Julia REPL",
            "env": {"JULIA_NUM_THREADS":"2"},
        }
    }

Or refer to the home folder in some other way? (Environment variable?)

0 Likes

#2

The shell_cmd should do the trick. It resolves the environment variables in the command string.

    {
        "caption": "Terminus: Open Julia Nightly",
        "command": "terminus_open",
        "args"   : {
            "shell_cmd": ["%LOCALAPPDATA%/Programs/Julia/Julia-1.4.0-DEV/bin/julia.exe"],
            "cwd": "${file_path:${folder}}",
            "title": "Julia REPL",
            "env": {"JULIA_NUM_THREADS":"2"},
        }
    },
1 Like

#3

Excellent, that worked. Thanks!

0 Likes

#4

Alas, it stopped working: Shell_cmd stopped working. I have no idea why, I think I’m still on the same version of ST3.

0 Likes

#5

IIRC, terminus was changed to accept a string only as shell_cmd instead of a list of arguments.

So, the following should work.

    {
        "caption": "Terminus: Open Julia Nightly",
        "command": "terminus_open",
        "args"   : {
            "shell_cmd": "%LOCALAPPDATA%/Programs/Julia/Julia-1.4.0-DEV/bin/julia.exe",
            "cwd": "${file_path:${folder}}",
            "title": "Julia REPL",
            "env": {"JULIA_NUM_THREADS":"2"},
        }
    },
0 Likes