VSCode Run Multiple Lines from File in Terminal Broken

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:


#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


#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.

# In the file
    a = 5+5
# Shift+Enter
# In the terminal


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

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


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


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

1 Like

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.


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 !

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