# CTRL+C based interrupt doesn't work in VSCode

**URL:** <https://discourse.julialang.org/t/ctrl-c-based-interrupt-doesnt-work-in-vscode/134023>\
**Category:** VS Code\
**Created:** [November 21, 2025, 11:24am UTC](https://discourse.julialang.org/t/ctrl-c-based-interrupt-doesnt-work-in-vscode/134023 "2025-11-21T11:24:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [November 21, 2025, 11:24am UTC](https://discourse.julialang.org/t/ctrl-c-based-interrupt-doesnt-work-in-vscode/134023/1 "2025-11-21T11:24:13Z")

</div>

Hello, if I run a long simulation (example below) in VSCode, CTRL+C interrupt works (or doesn’t) depending on how I have started calling the main simulation function:

If I have `mylongsimulation()` (the function call) in a file and I am evaluating that row (CTRL+ENTER) in VSCode, the CTRL+C then doesn’t work/interrupt, while if I type the same call command in the VSCode associated Julia terminal, CTRL+C works as expected.

Is there a workaround to have CTRL+C working even if I run `mylongsimulation()` from the main VSCode file panel ?

Example of a long-running function:

```julia-auto
function mylongsimulation()
    println("Starting long simulation...")
    for i1 in 1:100
        mylongssimulationinner1(i1)
    end
    println("Simulation complete")
end

function mylongssimulationinner1(i1)
    println("- Starting inner simulation 1 with i1 $i1...")
    for i2 in 1:10
        mylongssimulationinner2(i2)
    end
    return nothing
end

function mylongssimulationinner2(i2)
    println("-- Starting inner simulation 2 with i2 $i2...")
    for i in 1:10
        sleep(0.001)
    end
    return nothing
end

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/9/c9a12410ca7c139e81ee5a52797758a778ccefc7.png)

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [November 21, 2025, 11:36am UTC](https://discourse.julialang.org/t/ctrl-c-based-interrupt-doesnt-work-in-vscode/134023/2 "2025-11-21T11:36:09Z")

</div>

Got it.. for some reasons, if I am in the first case (running from the file editor) I need to use CTRL+C (capital C, i.e. CTRL+SHIFT+c)

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [November 21, 2025, 11:46am UTC](https://discourse.julialang.org/t/ctrl-c-based-interrupt-doesnt-work-in-vscode/134023/3 "2025-11-21T11:46:30Z")

</div>

FWIW, a very ugly workaround I use to stop long running calculations is to add something like

```julia-auto
isfile("stop_file") && return 

```

Such that the long running calculations return if the file is found. That’s particularly useful for parallel runs, where Control C usually breaks everything.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [November 26, 2025, 8:59pm UTC](https://discourse.julialang.org/t/ctrl-c-based-interrupt-doesnt-work-in-vscode/134023/5 "2025-11-26T20:59:24Z")

</div>

You can set another keybinding for `language-julia.interrupt` if you want, but `Ctrl-C` obviously conflicts with copying things.

---

<div class="post-metadata">

**Author:** ![ElOceanografo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eloceanografo/32/624_2.png) [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Post date:** [November 27, 2025, 5:03am UTC](https://discourse.julialang.org/t/ctrl-c-based-interrupt-doesnt-work-in-vscode/134023/6 "2025-11-27T05:03:40Z")

</div>

Ha, that’s awful, I love it!
