# How to stop a cell in VS Code

**URL:** <https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010>\
**Category:** New to Julia\
**Tags:** vscode\
**Created:** [April 25, 2022, 7:48pm UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010 "2022-04-25T19:48:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![chadagreene](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chadagreene/32/34924_2.png) [@chadagreene](https://discourse.julialang.org/u/chadagreene)\
**Post date:** [April 25, 2022, 7:48pm UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/1 "2022-04-25T19:48:02Z")

</div>

How do I stop a cell that’s running in VS Code? The **Stop** button does nothing at all, nor does Ctrl+C. Since I took this screenshot, the cell chugged along for another 10 minutes until I finally gave up and had to restart VS Code.

 ![Screen Shot 2022-04-25 at 12.39.01 PM](https://global.discourse-cdn.com/julialang/original/3X/6/8/6800dd908b263195ef0a07925eff9dbfc90832a2.png)

---

<div class="post-metadata">

**Author:** ![Iddingsite](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iddingsite/32/31840_2.png) [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Post date:** [April 25, 2022, 8:28pm UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/2 "2022-04-25T20:28:53Z")

</div>

Do you have the Julia extension installed? If not you should.  
If it is the case, if you have a running cell for too long, the best way is to stop the notebook in the workspace like here, by pressing the red rectangle:

![Capture d’écran 2022-04-25 à 22.28.23](https://global.discourse-cdn.com/julialang/original/3X/6/a/6ac90ed9f1f4c78972f5e8f30687dfeed776da77.png)

EDIT: there is a similar topic here: [Can't restart kernel in VSCode jupyter notebook](https://discourse.julialang.org/t/cant-restart-kernel-in-vscode-jupyter-notebook/68136)

---

<div class="post-metadata">

**Author:** ![Jaepil\_Lee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jaepil_lee/32/9146_2.png) [@Jaepil\_Lee](https://discourse.julialang.org/u/Jaepil_Lee)\
**Post date:** [June 6, 2022, 12:36am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/3 "2022-06-06T00:36:36Z")

</div>

This doesn’t kill the running cell, in the sense that I still see a timer in the code block running. The workspace is wiped out as it should, but I can’t go beyond the code block where I stopped.

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [June 6, 2022, 1:56am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/4 "2022-06-06T01:56:31Z")

</div>

I have the same question.

---

<div class="post-metadata">

**Author:** ![Jaepil\_Lee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jaepil_lee/32/9146_2.png) [@Jaepil\_Lee](https://discourse.julialang.org/u/Jaepil_Lee)\
**Post date:** [June 6, 2022, 2:37am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/5 "2022-06-06T02:37:39Z")

</div>

Hi photor, if you can, can you also post your issue on [microsoft/vscode-jupyter](https://github.com/microsoft/vscode-jupyter)? Having more voices would speed up solving the problem.

---

<div class="post-metadata">

**Author:** ![nbagg](https://avatars.discourse-cdn.com/v4/letter/n/85e7bf/32.png) [@nbagg](https://discourse.julialang.org/u/nbagg)\
**Post date:** [September 21, 2022, 2:07am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/6 "2022-09-21T02:07:48Z")

</div>

I am also having the same problem.

---

<div class="post-metadata">

**Author:** ![ilkerduymaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ilkerduymaz/32/38855_2.png) [@ilkerduymaz](https://discourse.julialang.org/u/ilkerduymaz)\
**Post date:** [September 27, 2022, 8:45am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/7 "2022-09-27T08:45:45Z")

</div>

Same here, I can’t interrupt running cells in any way except restarting VSCode. I tried setting up a WSL environment to run Julia because as far as I know interrupting cells only works in Linux with Pluto.jl. But that didn’t help at all…

Currently the vscode-jupyter workflow is unusable for me because frequently having to restart VSCode is too bothersome. Really hoping that this will be solved someday.

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [September 27, 2022, 10:06am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/8 "2022-09-27T10:06:31Z")

</div>

You don’t need to restart vscode. Only restarting the julia kernel is needed. But it’s definitely more convenient to be able to simply stop a running cell.

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [October 10, 2022, 8:14pm UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/9 "2022-10-10T20:14:09Z")

</div>

If I kill a cell or the workspace, the cell still thinks its executing… and runs like that forever. I have to restart vscode entirely.

---

<div class="post-metadata">

**Author:** ![willem.mazzotti](https://avatars.discourse-cdn.com/v4/letter/w/a9adbd/32.png) [@willem.mazzotti](https://discourse.julialang.org/u/willem.mazzotti)\
**Post date:** [January 22, 2023, 9:49pm UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/10 "2023-01-22T21:49:09Z")

</div>

Hi! Have this issue been resolved? Same problem for me. Changing / restarting the kernel doesn’t work either.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 22, 2023, 10:05pm UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/11 "2023-01-22T22:05:34Z")

</div>

In OP’s example there is a large heatmap that takes time to display and AFAIK it is not possible to CTRL+C it, unlike higher level code, such as loops, etc.

What can be done in such cases is to kill Julia with `Alt+J Alt+K`, see [Julia-VS Code keybindings](https://www.julia-vscode.org/docs/dev/userguide/keybindings/). And then restart Julia again.

This is equivalent to pressing the Kill Terminal trash bin icon:

 ![VS_code_kill_terminal](https://global.discourse-cdn.com/julialang/original/3X/0/3/03dfcf2dd3afd88a7754544244cb85018fd04753.png)

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [January 23, 2023, 2:43am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/12 "2023-01-23T02:43:03Z")

</div>

Killing is not the same as stopping …

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 23, 2023, 6:23am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/13 "2023-01-23T06:23:15Z")

</div>

Indeed, but the point was that killing might be the only way to stop low-level functions like OP’s heatmap.

---

<div class="post-metadata">

**Author:** ![luchino\_96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luchino_96/32/29329_2.png) [@luchino\_96](https://discourse.julialang.org/u/luchino_96)\
**Post date:** [February 28, 2024, 6:52pm UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/15 "2024-02-28T18:52:32Z")

</div>

Same problem, its very problematic and its quite baffling that it has not been resolved yet tbh.

---

<div class="post-metadata">

**Author:** ![asoluer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asoluer/32/209928_2.png) [@asoluer](https://discourse.julialang.org/u/asoluer)\
**Post date:** [July 11, 2024, 9:20am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/16 "2024-07-11T09:20:02Z")

</div>

Has this problem still not been solved until today?

---

<div class="post-metadata">

**Author:** ![TimG](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@TimG](https://discourse.julialang.org/u/TimG)\
**Post date:** [July 11, 2024, 10:50am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/17 "2024-07-11T10:50:51Z")

</div>

I have to click that stop button twice but then it does work.

---

<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:** [July 11, 2024, 8:36pm UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/18 "2024-07-11T20:36:49Z")

</div>

Perhaps some of you could consider a different julia development workflow using directly a Julia script (.jl) rather than using a notebook. You can still run code line by line, and I think there is a sintax to define “cells” inplemented as as julia comments and run the code cell by cell if one wish…

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [July 12, 2024, 2:41am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/19 "2024-07-12T02:41:06Z")

</div>

How to do that with a .jl?

---

<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:** [July 12, 2024, 5:07am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/20 "2024-07-12T05:07:48Z")

</div>

> [@photor](#):
>
> that

What do you mean?  
If you install the VS Code julia extension then you can make a new Julia file (.jl, just a text file) and run the commands line by line.  
Attached to the session you always have a julia terminal at the bottom, where you can eventually use to CTRL-C/ CTRL-D a session, and in the worst scenario (happened very very rarely to me) kill the terminal. This istantaneusly kill the Julia session, but at least you have your VSCode still there open in front of you .

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [July 12, 2024, 9:32am UTC](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010/21 "2024-07-12T09:32:30Z")

</div>

I mean how to define cells in this scenario?

[Next page](https://discourse.julialang.org/t/how-to-stop-a-cell-in-vs-code/80010.md?page=2)
