# How to run code cell in a REPL that I already opened in VS code?

**URL:** https://discourse.julialang.org/t/how-to-run-code-cell-in-a-repl-that-i-already-opened-in-vs-code/79457
**Category:** New to Julia
**Tags:** question
**Created:** [April 13, 2022, 8:42pm UTC](https://discourse.julialang.org/t/how-to-run-code-cell-in-a-repl-that-i-already-opened-in-vs-code/79457 "2022-04-13T20:42:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![neuro\_enthusiast](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@neuro\_enthusiast](https://discourse.julialang.org/u/neuro_enthusiast)
#### Post date: [April 13, 2022, 8:42pm UTC](https://discourse.julialang.org/t/how-to-run-code-cell-in-a-repl-that-i-already-opened-in-vs-code/79457/1 "2022-04-13T20:42:50Z")

</div>

When I run alt-enter on a code cell/ code block after opening up VS code, it automatically opens up a REPL, even if I already opened one up within VS code. Is there a way to run code cells within a REPL I already opened without copy pasting (by doing alt-enter instead)? Thank you!

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [April 13, 2022, 9:22pm UTC](https://discourse.julialang.org/t/how-to-run-code-cell-in-a-repl-that-i-already-opened-in-vs-code/79457/2 "2022-04-13T21:22:46Z")

</div>

If you open the VSCode REPL with the dedicated command, your code lines should be run there. Maybe the issue is that you opened your REPL by typing `julia` into a VSCode terminal? In which case VSCode will launch a new REPL which it recognizes as a Julia REPL (and not a simple terminal)

---

<div class="post-metadata">

### Author: ![neuro\_enthusiast](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@neuro\_enthusiast](https://discourse.julialang.org/u/neuro_enthusiast)
#### Post date: [April 13, 2022, 9:52pm UTC](https://discourse.julialang.org/t/how-to-run-code-cell-in-a-repl-that-i-already-opened-in-vs-code/79457/3 "2022-04-13T21:52:33Z")

</div>

thanks!!

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [April 13, 2022, 9:56pm UTC](https://discourse.julialang.org/t/how-to-run-code-cell-in-a-repl-that-i-already-opened-in-vs-code/79457/4 "2022-04-13T21:56:03Z")

</div>

You can also use the “connect to external REPL” command, even if it’s a repl launched inside VS code

---

<div class="post-metadata">

### Author: ![neuro\_enthusiast](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@neuro\_enthusiast](https://discourse.julialang.org/u/neuro_enthusiast)
#### Post date: [April 13, 2022, 10:05pm UTC](https://discourse.julialang.org/t/how-to-run-code-cell-in-a-repl-that-i-already-opened-in-vs-code/79457/5 "2022-04-13T22:05:40Z")

</div>

> [@kevbonham](#):
>
> connect to external REPL”

Would you be willing to link resources that explain this option in more detail?

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [April 14, 2022, 12:15am UTC](https://discourse.julialang.org/t/how-to-run-code-cell-in-a-repl-that-i-already-opened-in-vs-code/79457/6 "2022-04-14T00:15:55Z")

</div>

It’s never obvious to me where to find the docs, but the short version is: open the command pallette (ctrl+shift+P), type “REPL” and you should see something like “connect to external REPL,” which will give you a code that you can paste into an open REPL.

---

<div class="post-metadata">

### Author: ![neuro\_enthusiast](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@neuro\_enthusiast](https://discourse.julialang.org/u/neuro_enthusiast)
#### Post date: [April 14, 2022, 8:41am UTC](https://discourse.julialang.org/t/how-to-run-code-cell-in-a-repl-that-i-already-opened-in-vs-code/79457/7 "2022-04-14T08:41:09Z")

</div>

thanks for sharing!
