# Encountering usability issues with the REPL

**URL:** <https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [November 30, 2024, 8:01pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301 "2024-11-30T20:01:56Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elias\_Al\_Alam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elias_al_alam/32/213855_2.png) [@Elias\_Al\_Alam](https://discourse.julialang.org/u/Elias_Al_Alam)\
**Post date:** [November 30, 2024, 8:01pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/1 "2024-11-30T20:01:56Z")

</div>

![Screenshot From 2024-11-30 20-57-22](https://global.discourse-cdn.com/julialang/original/3X/e/3/e3c827552965eb5cf8287ec7eef4477f587af179.png)  
So whenever i click run this REPL seems to be the default and it runs a bit a too slow and when i have something that requires input then it just gets stuck. On top of that the other way which is run “Run file in new Process”, this works but in every loop i need to specify local and global but if i run julia and run same code in terminal it will work without the need of all that so what is that doing differently and also it feels like it’s compiling or something because it also take longer to start than just copy pasting code in terminal. What i want to know and couldnt figure out is there a way to just make the run button run it in vscode same as when am running a python code for example? i tried removing this REPL option totally but i didn’t manage to do that.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [November 30, 2024, 8:11pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/2 "2024-11-30T20:11:05Z")

</div>

Well, the REPL is very nice and powerful. If you come from Python, you need to change your workflow anyways. One reason is that loading packages in Julia can take some time, and it is better to keep the REPL open and then just type:

```julia
include("src/myscript.jl")

```

to run a script. And if you want to run it again \<UP ARROW\>\<ENTER\> is sufficient due to the nice command line history. Furthermore you can use the \<TAB\> key to autocomplete the line that you are typing.

I am not using any of the fancy VSCode buttons to run Julia scripts. Instead, I use a Bash shell (Terminal-\>new Terminal in the menu), launch Julia with `julia --project` or a custom Bash shortcut and then run my scripts as explained above.

See also: [Working with Julia projects | Julia programming notes](https://ufechner7.github.io/2022/08/16/julia-projects.html)

Sorry for not answering your question but suggesting a different workflow instead. And welcome in the Julia community!

---

<div class="post-metadata">

**Author:** ![Elias\_Al\_Alam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elias_al_alam/32/213855_2.png) [@Elias\_Al\_Alam](https://discourse.julialang.org/u/Elias_Al_Alam)\
**Post date:** [November 30, 2024, 8:27pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/3 "2024-11-30T20:27:38Z")

</div>

Thank you so much for the reply.  
Is it normal when i first run the code in REPL that it keeps “Evaluating” for like a loong time?

 ![Screenshot From 2024-11-30 21-27-28](https://global.discourse-cdn.com/julialang/original/3X/7/5/757f84c8ebed7be2cea9e258ca29bd4bc932811a.png)

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [November 30, 2024, 8:32pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/4 "2024-11-30T20:32:48Z")

</div>

I guess that depends on the code you are trying to run. Can you share it?

And if you share code, please do not share a screenshot, but instead copy-and-paste the code and include it in triple backticks, like ``` .

---

<div class="post-metadata">

**Author:** ![Elias\_Al\_Alam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elias_al_alam/32/213855_2.png) [@Elias\_Al\_Alam](https://discourse.julialang.org/u/Elias_Al_Alam)\
**Post date:** [November 30, 2024, 8:34pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/5 "2024-11-30T20:34:04Z")

</div>

```julia
n = parse(Int, readline())
i = 0

while i < n
    println("$(i^2)")
    global i += 1
end

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [November 30, 2024, 8:38pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/6 "2024-11-30T20:38:17Z")

</div>

I first launched a terminal using the VSCode menu, and then typed:

```julia
ufechner@framework:~/repos $ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.10.7 (2024-11-26)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> n = parse(Int, readline())
2
2

julia> i = 0
0

julia> while i < n
           println("$(i^2)")
           global i += 1
       end
0
1

```

There was no delay apart from the fact that `readline()` waits for user input, so I typed `2 <ENTER>` .

---

<div class="post-metadata">

**Author:** ![Elias\_Al\_Alam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elias_al_alam/32/213855_2.png) [@Elias\_Al\_Alam](https://discourse.julialang.org/u/Elias_Al_Alam)\
**Post date:** [November 30, 2024, 8:40pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/7 "2024-11-30T20:40:52Z")

</div>

Yes!! Same for me, but my problem is with the “Execute active file in REPL” in VSCode, when i do that then the Julia REPL terminal appears and the evaluating thing starts.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [November 30, 2024, 8:41pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/8 "2024-11-30T20:41:30Z")

</div>

> [@Elias\_Al\_Alam](#):
>
> “Execute active file in REPL”

I never use this command, so someone else has to comment on that.

---

<div class="post-metadata">

**Author:** ![Elias\_Al\_Alam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elias_al_alam/32/213855_2.png) [@Elias\_Al\_Alam](https://discourse.julialang.org/u/Elias_Al_Alam)\
**Post date:** [November 30, 2024, 8:42pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/9 "2024-11-30T20:42:16Z")

</div>

Okay, Thank you so much sir for replying and the for the help. I hope you have a lovely evening.

---

<div class="post-metadata">

**Author:** ![adienes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adienes/32/37459_2.png) [@adienes](https://discourse.julialang.org/u/adienes)\
**Post date:** [November 30, 2024, 8:42pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/10 "2024-11-30T20:42:57Z")

</div>

Hi @Elias_Al_Alam , welcome to the community! I’ve edited your title to be a bit less sharply worded — so that any contributors are more likely to focus on the content and not the title — I hope that’s ok.

---

<div class="post-metadata">

**Author:** ![Elias\_Al\_Alam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elias_al_alam/32/213855_2.png) [@Elias\_Al\_Alam](https://discourse.julialang.org/u/Elias_Al_Alam)\
**Post date:** [November 30, 2024, 8:44pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/11 "2024-11-30T20:44:53Z")

</div>

Yes, thank you, sorry i was really frustrated. Apologies.

---

<div class="post-metadata">

**Author:** ![bertschi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bertschi/32/33462_2.png) [@bertschi](https://discourse.julialang.org/u/bertschi)\
**Post date:** [November 30, 2024, 11:06pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/12 "2024-11-30T23:06:55Z")

</div>

Have just checked and the `readline()` seems to be the issue, i.e., the REPL starts just fine and then waits for your input (as you did not print a prompt this is hard to see and as your code is not done at that point the IDE shows _evaluating_).  
Now, for some reason the input needs to be repeated twice … don’t know why, but could be a bug in the REPL confusing inputs.

In any case, I would also suggest a different workflow:

1. Start a REPL using `Julia: Start REPL` from the command menu
2. Select and send code to the REPL via Shift+Enter

Seems the confusing behaviour of `readline()` also occurs in this case though … typing the code into the REPL directly works as expected.

---

<div class="post-metadata">

**Author:** ![Elias\_Al\_Alam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elias_al_alam/32/213855_2.png) [@Elias\_Al\_Alam](https://discourse.julialang.org/u/Elias_Al_Alam)\
**Post date:** [November 30, 2024, 11:23pm UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/13 "2024-11-30T23:23:58Z")

</div>

Thank you so much; Yes it worked!! If i open REPL `Julia: Start REPL` and then in the new opened REPL i use the command ``ìnclude(“directory location”)``` sir @ufechner7 gave me then the code runs quick and without any problems at all. Thank you both.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [December 1, 2024, 1:00am UTC](https://discourse.julialang.org/t/encountering-usability-issues-with-the-repl/123301/14 "2024-12-01T01:00:52Z")

</div>

It is a long known bug in the julia vscode extension that reading input like that doesn’t work correctly when running code blocks through the extension and not directly from the repl. It has something to do with asynchronous tasks that don’t interact well together
