# Readline() doesn't work on VS Code

**URL:** https://discourse.julialang.org/t/readline-doesnt-work-on-vs-code/121032
**Category:** VS Code
**Tags:** question, vscode
**Created:** [October 8, 2024, 12:57am UTC](https://discourse.julialang.org/t/readline-doesnt-work-on-vs-code/121032 "2024-10-08T00:57:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![uri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uri/32/219969_2.png) [@uri](https://discourse.julialang.org/u/uri)
#### Post date: [October 8, 2024, 12:57am UTC](https://discourse.julialang.org/t/readline-doesnt-work-on-vs-code/121032/1 "2024-10-08T00:57:11Z")

</div>

When I run the following from VS Code it print a line asking for the degree, I enter it in the REPL but the program still waiting for an input

function main()  
print("Give the degree : ")  
line = readline()  
deg = parse(Int, line)  
.  
.  
.

---

<div class="post-metadata">

### Author: ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)
#### Post date: [October 8, 2024, 6:02am UTC](https://discourse.julialang.org/t/readline-doesnt-work-on-vs-code/121032/2 "2024-10-08T06:02:07Z")

</div>

Hello uri! Welcome to the Julia Discourse! I hope you enjoy your experience with the programming language and in this community.

What you describe is a known bug of the VS Code extension for Julia. You can follow the issue, with some suggested workarounds while a solution is looked for, here:

> <https://github.com/julia-vscode/julia-vscode/issues/785>
>
> There seems to be an issue with the new terminal communication and reading stdin…. Executing the file
> \`\`\`julia
> for n in 1:5
> println(n)
> readline()
> end
> \`\`\`
> through vscode will drop back to the REPL prompt after the first iteration. Loading the same file with include() works as expected.
> 
> Version: 0.12.0-beta.2
> OS: Windows 10

As a side note, the excerpt of code that you posted was incomplete - at least it lacked the `end` of the function, and to make it more readable it’s recommendable to format it as code, enclosing it between “triple backticks”. See more recommendations and best practices here, in case you didn’t read it yet:

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

### Author: ![uri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uri/32/219969_2.png) [@uri](https://discourse.julialang.org/u/uri)
#### Post date: [October 8, 2024, 11:22pm UTC](https://discourse.julialang.org/t/readline-doesnt-work-on-vs-code/121032/3 "2024-10-08T23:22:45Z")

</div>

Thanks a lot!!!
