# VSCode Run Multiple Lines from File in Terminal Broken

**URL:** <https://discourse.julialang.org/t/vscode-run-multiple-lines-from-file-in-terminal-broken/94796>\
**Category:** VS Code\
**Created:** [February 17, 2023, 4:19pm UTC](https://discourse.julialang.org/t/vscode-run-multiple-lines-from-file-in-terminal-broken/94796 "2023-02-17T16:19:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrufsvold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrufsvold/32/31600_2.png) [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Post date:** [February 17, 2023, 4:19pm UTC](https://discourse.julialang.org/t/vscode-run-multiple-lines-from-file-in-terminal-broken/94796/1 "2023-02-17T16:19:21Z")

</div>

EDITED: I was able to narrow down the problem a bit.

I recently updated Julia to v1.9.0-beta4. Previously I was on v1.8.2. I have been using v1.41.1 Pre-Release of the Julia VSCode extension.

After updating Julia versions, I’m getting a strange behavior with Shift+Enter to run selected code in active terminal.  
If I have `using DataFrames \n using CSV` in a file, highlight both lines, and hit Shift+Enter, my terminal looks like this:

```julia
julia>

#87using DataFrames

```

It hangs on that `#87using DataFrames` line forever. If I click into the terminal and hit enter, it pops down to a new line and allows me to use the REPL. But DataFrames isn’t active

```julia
julia>

#87using DataFrames

julia> DataFrames
ERROR: UndefVarError: `DataFrames` not defined

```

If I run each line separately whether I highlight all or part of the line or just shift enter to run that line, it works. I still get the weird `#87` in front of each line, but the code executes correctly.

It also hangs/does not execute anything for any multiline blocks that are sent to the terminal with Shift+Enter even with no highlighting.This is not limited to `using` statements.

```julia
# In the file
begin 
    a = 5+5
end
# Shift+Enter
# In the terminal

#87begin 
julia> 

julia> a
ERROR: UndefVarError: `a` not defined
```

---

<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:** [February 17, 2023, 6:09pm UTC](https://discourse.julialang.org/t/vscode-run-multiple-lines-from-file-in-terminal-broken/94796/2 "2023-02-17T18:09:01Z")

</div>

I had the same problem, and for the moment I just downgraded to 1.8.5.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [February 18, 2023, 6:21am UTC](https://discourse.julialang.org/t/vscode-run-multiple-lines-from-file-in-terminal-broken/94796/3 "2023-02-18T06:21:49Z")

</div>

Afaik the extension is currently not expected to work on 1.9beta.

---

<div class="post-metadata">

**Author:** ![tfiers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tfiers/32/32427_2.png) [@tfiers](https://discourse.julialang.org/u/tfiers)\
**Post date:** [March 5, 2023, 12:54pm UTC](https://discourse.julialang.org/t/vscode-run-multiple-lines-from-file-in-terminal-broken/94796/4 "2023-03-05T12:54:49Z")

</div>

Filed as [Julia 1.9 regression: Running multiple lines from a file in the REPL does not work anymore · Issue #3235 · julia-vscode/julia-vscode · GitHub](https://github.com/julia-vscode/julia-vscode/issues/3235)

---

<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:** [March 7, 2023, 7:24pm UTC](https://discourse.julialang.org/t/vscode-run-multiple-lines-from-file-in-terminal-broken/94796/5 "2023-03-07T19:24:42Z")

</div>

Anyone knows if this is being worked out? It makes VSCode somewhat hard to use with 1.9, it wouldn’t be nice if 1.9 was launched with VSCode broken for it.

---

<div class="post-metadata">

**Author:** ![fdekerme](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fdekerme/32/43574_2.png) [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Post date:** [May 10, 2023, 9:26pm UTC](https://discourse.julialang.org/t/vscode-run-multiple-lines-from-file-in-terminal-broken/94796/6 "2023-05-10T21:26:13Z")

</div>

Hello !  
I encounter this error after switching from 1.8.5 to 1.9.0.  
I did a Pkg.up though.  
Maybe the Julia VSCode extension is not already available?  
Any solutions?

**EDIT : The problem disappears when I switch to the Pre-relaese version of the Julia extension in vscode.**

Thanks !

---

<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:** [May 11, 2023, 4:44pm UTC](https://discourse.julialang.org/t/vscode-run-multiple-lines-from-file-in-terminal-broken/94796/7 "2023-05-11T16:44:56Z")

</div>

The bug has been fixed already, maybe you only need an update of the extension there, even in the release version.
