How to launch Julia with command-line arguments in VS Code?

I usually start Julia with some command-line options when starting it from a terminal. How to do this when using the Julia REPL in the Code editor?

2 Likes

You can specify them as a JSON list in your Settings.json file under the julia.additionalArgs setting. e.g.

{
    ...,
    "julia.additionalArgs": [
        "--startup-file=no",
        "--color=no"
    ]
}
11 Likes

Or, start a terminal, and in the terminal one can start Julia in any way the heart desires.

1 Like

That Julia instance will not have any of the integrations, though. Things like workspace, plot pane, debugger, code execution all will not work with that. Essentially the Julia extension won’t know about that Julia instance and just ignore it.

5 Likes

Though you can of course connect it to VS Code with the “Julia: Connect external REPL” command.

4 Likes

Can I get more guidance on this? I want to start up Julia with multiple threads and run scripts line by line from the REPL. I am avoiding the edit settings.json route because I want to use different number of threads each session depending on other activities. When I use the connect to external REPL command, it still starts a new Julia REPL instance when I run code from the script. Any resources or guidance is appreciated. I miss Atom :frowning:

I added the --threads command to the Workspace.json file and this will work for now. It would be nice to specify the number of threads when launching the Julia REPL instance. If anyone has ideas, please share, but for now we can consider this resolved.