# VS Code - Can't run Julia without debugging

**URL:** <https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944>\
**Category:** VS Code\
**Created:** [July 12, 2020, 1:43pm UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944 "2020-07-12T13:43:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![reinermartin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/reinermartin/32/25574_2.png) [@reinermartin](https://discourse.julialang.org/u/reinermartin)\
**Post date:** [July 12, 2020, 1:43pm UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944/1 "2020-07-12T13:43:45Z")

</div>

For a few weeks now the command “Run Without Debugging” in VS Code runs Julia _with_ debugging. This is true on three different machines. Is there something obvious I might be doing wrong?

I am running the latest version of VS Code and of the extension. I am not sure whether the behavior started after updating VS Code or the extension. I am running Windows 10.

Thanks in advance for any pointers here!

---

<div class="post-metadata">

**Author:** ![martincornejo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martincornejo/32/13436_2.png) [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Post date:** [July 12, 2020, 2:04pm UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944/2 "2020-07-12T14:04:58Z")

</div>

To run a Julia file open the VS Code command palette with `ctrl+shift+P` and search for `Julia: Execute File`. To add a keybinding to the command open the command palette (`ctrl+shift+P`) and search for `Preferences: Open Keyboard Shortcuts`, then search for `Julia: Execute File` and add the desired keybinding (for example `ctrl+shift+Enter`).

---

<div class="post-metadata">

**Author:** ![reinermartin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/reinermartin/32/25574_2.png) [@reinermartin](https://discourse.julialang.org/u/reinermartin)\
**Post date:** [July 12, 2020, 2:16pm UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944/3 "2020-07-12T14:16:27Z")

</div>

Thanks for your response. However, if I “Julia: Execute File”, then it seems to open the Julia REPL. Can I not just run Julia in the shell from VS Code, as I could before?

---

<div class="post-metadata">

**Author:** ![reinermartin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/reinermartin/32/25574_2.png) [@reinermartin](https://discourse.julialang.org/u/reinermartin)\
**Post date:** [July 12, 2020, 3:14pm UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944/4 "2020-07-12T15:14:14Z")

</div>

Let me try to be a bit more precise. I tried different versions of the Julia extension and execute “Run Without Debugging” on a script containing

```julia
using Primes
println(primes(100))

```

- V.0.14.18: I get an error pop-up “configured debug type ‘julia’ is not supported”
- V.0.15.40: everything look fine, script runs in 3 seconds
- V.0.16.11 and V.0.17.2: I get message " Warning: Package VSCodeDebugger does not have Primes in its dependencies:", script runs in 5 seconds

If I use the shell inside VS Code however, the script executes more or less instantly.

So, in each case using “Run Without Debugging” seems to do something which increases startup time substantially. It looks like it does indeed do something debugging-related. What am I missing?

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [July 12, 2020, 3:17pm UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944/5 "2020-07-12T15:17:21Z")

</div>

@davidanthoff Can you help with this?

---

<div class="post-metadata">

**Author:** ![EHBaozi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ehbaozi/32/14854_2.png) [@EHBaozi](https://discourse.julialang.org/u/EHBaozi)\
**Post date:** [July 12, 2020, 5:27pm UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944/6 "2020-07-12T17:27:23Z")

</div>

If you’re just trying to execute the file, I don’t think you should use run without debugging, since that still executes the file through JuliaInterpreter.jl which can be really slow for non-trivial scripts. Just open a shell and do `julia filename.jl`.

That message you’re getting with 0.16 and 0.17 does seem like a bug though. Maybe file an issue?

---

<div class="post-metadata">

**Author:** ![reinermartin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/reinermartin/32/25574_2.png) [@reinermartin](https://discourse.julialang.org/u/reinermartin)\
**Post date:** [July 12, 2020, 5:58pm UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944/7 "2020-07-12T17:58:57Z")

</div>

OK, thanks @EHBaozi and all. That would explain the difference in execution time I have experienced. I’ll use the shell in the future, and I have a closer look at the ‘tasks’ in VS Code, I guess they allow me to make this more convenient.

I’ll try to file an issue re the potential bug some other time.

---

<div class="post-metadata">

**Author:** ![reinermartin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/reinermartin/32/25574_2.png) [@reinermartin](https://discourse.julialang.org/u/reinermartin)\
**Post date:** [July 12, 2020, 6:22pm UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944/8 "2020-07-12T18:22:38Z")

</div>

I have managed to set things up such I can just hit `F5` to start Julia in the shell with the file I am working on. For future reference, maybe anyone finds this useful:

I’ve put this into `tasks.json`:

```julia
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run Julia from Shell",
            "type": "process",
            "command": "julia",
            "args": ["${file}"],
            "problemMatcher": []
        }
    ]
}

```

And added this to `keybindings.json`:

```julia
    {
        "key": "f5",
        "command": "workbench.action.tasks.runTask",
        "args": "Run Julia from Shell"
    }

```

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [July 13, 2020, 3:26am UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944/9 "2020-07-13T03:26:27Z")

</div>

I think there is a bug in VS Code itself that makes the run or debut mode sticky for the current session. So if you debugged first, all subsequent runs will actually be debugs, if you run first, all subsequent debugs will actually be runs. I think they merged a fix and it might have shipped in their latest release.

---

<div class="post-metadata">

**Author:** ![thudjx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thudjx/32/15231_2.png) [@thudjx](https://discourse.julialang.org/u/thudjx)\
**Post date:** [March 7, 2021, 10:18am UTC](https://discourse.julialang.org/t/vs-code-cant-run-julia-without-debugging/42944/10 "2021-03-07T10:18:22Z")

</div>

Hi all! I am encountering a similar problem. I can **run** the file as expected but I can’t **run and debug** the file. I have deleted the `.vscode` directory, expecting debugger will work by default but it didn’t work.

I am not sure where the problem comes from, as vs code used to work quite well. I have been coding in python for the last few weeks but when I came back to Julia, this wired thing happened.

Do you guys have any idea about this?
