# Discussion on improving Julia REPL for beginners

**URL:** <https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933>\
**Category:** General Usage\
**Tags:** repl\
**Created:** [June 17, 2022, 6:57pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933 "2022-06-17T18:57:55Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdheepak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kdheepak/32/10881_2.png) [@kdheepak](https://discourse.julialang.org/u/kdheepak)\
**Post date:** [June 17, 2022, 6:57pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/1 "2022-06-17T18:57:55Z")

</div>

I wanted to start a discussion on some features that I think it would be nice to have in the Julia REPL by default, and some features that exist in `ipython` already.

1. Convey difference visually between input prompt, expression’s return value and stdout

For example, here is Julia’s REPL when you run `1 + 1` and `println(1 + 1)`.

 ![Screen Shot 2022-06-17 at 11.18.40 AM](https://global.discourse-cdn.com/julialang/original/3X/0/2/02c802c85c93863d8b5b6f718f0266db07096f3c.png)

Here’s the same thing with `ipython`.

 ![Screen Shot 2022-06-17 at 11.18.17 AM](https://global.discourse-cdn.com/julialang/original/3X/c/d/cdc3ea25aab712799827fbad863fb6e9beceace5.png)

With `ipython`, there’s a difference between what is stdout and what is the returned value of the expression evaluated. I’ve found when teaching beginners how to code, this can a big source of frustration or confusion.

1. Having `zsh` or `fish` shell like completions.

You’ll notice in the screenshot above, when I type `p` in the `ipython` REPL the REPL hints that the history contains a expression that begins with the same character. In `zsh` or `fish` or `ipython`, I can hit the Right arrow key and this populates the prompt with that expression.

1. TAB and S-TAB for autocompletion cycling

In the default Julia REPL, hitting TAB first completes to the longest common completion, and then further presses only prints the same completions over and over again. When there are a large number of completions, this results in the terminal history being polluted. It would be nice to cycle through options the way `ipython` does.

[https://user-images.githubusercontent.com/1813121/174386483-13a06663-392e-42ea-afed-3d680a1d6ff0.mov](https://user-images.githubusercontent.com/1813121/174386483-13a06663-392e-42ea-afed-3d680a1d6ff0.mov)

1. Syntax highlighting

This can be achieved using OhMyREPL but it would be nice to get this by default.

I personally would like to see a better REPL out of the box, or at least an alternative REPL that one could alias to.

Are there other features one would like to see in a Julia REPL? I wanted to start a discussion to brainstorm some ideas here. I’m interested in making this happen and would be willing to work on it too.

For example, one feature that I’d like is if I ever run `julia` in a folder where there’s a `Project.toml` file, I’d like the `julia>` prompt to change to `julia * >` or something like that. In almost all instances, if I’m running `julia` in a folder where there’s a `Project.toml`, I’d imagine the user would want the environment activated by default or at least warn that there is an environment to be activated in that folder.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [June 17, 2022, 7:57pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/2 "2022-06-17T19:57:03Z")

</div>

Most of the advanced users here tend to copy REPL code with the `julia>` prompt and the output:

```julia
julia> x = 1
1

julia> sin(x)
0.8414709848078965

```

This is a bit annoying to read and to cut and paste. It would be nice to have in the REPL menu a copy mode that would just copy the input after the prompt:

```julia
x = 1
sin(x)

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 17, 2022, 8:05pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/3 "2022-06-17T20:05:33Z")

</div>

> [@kdheepak](#):
>
> With `ipython`, there’s a difference between what is stdout and what is the returned value of the expression evaluated. I’ve found when teaching beginners how to code, this can a big source of frustration or confusion

You can also do this with OhMyREPL:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/1/b10bedb4c1febeda27c6c747401c2cf48e3b89d7.png)

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 17, 2022, 8:11pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/4 "2022-06-17T20:11:36Z")

</div>

> [@kdheepak](#):
>
> It would be nice to cycle through options the way `ipython` does.

See [Fish or ipython-like completion with tab key by bicycle1885 · Pull Request #43838 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/43838)

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 17, 2022, 8:41pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/5 "2022-06-17T20:41:26Z")

</div>

> [@kristoffer.carlsson](#):
>
> You can also do this with OhMyREPL:

I added an easy way to get Ipython prompts with OMR: [add an easy way to get Ipython prompts by KristofferC · Pull Request #270 · KristofferC/OhMyREPL.jl · GitHub](https://github.com/KristofferC/OhMyREPL.jl/pull/270)

![Screenshot 2022-06-17 at 22.42.59](https://global.discourse-cdn.com/julialang/original/3X/f/e/fee04d93a07ed2f7a74fe30269ba1fde13c59517.png)

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [June 17, 2022, 8:47pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/6 "2022-06-17T20:47:08Z")

</div>

Why would that be more useful? You can just paste that snippet into the REPL.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [June 17, 2022, 8:49pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/7 "2022-06-17T20:49:59Z")

</div>

I would like to paste it into VS Code instead, run it from there and, if I like it, keep it for the future as a repository of good ideas.

And sorry, how do you paste it to the REPL with the prompt and the whole shebang?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 17, 2022, 9:00pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/8 "2022-06-17T21:00:02Z")

</div>

> [@rafael.guerra](#):
>
> And sorry, how do you paste it to the REPL with the prompt and the whole shebang?

Just paste it. Might not work on Windows.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [June 17, 2022, 9:01pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/9 "2022-06-17T21:01:51Z")

</div>

> [@kristoffer.carlsson](#):
>
> Might not work on Windows.

Thanks, it doesn’t work on my Win 11 installation. Are there any Windows Julia users who have had success?

---

<div class="post-metadata">

**Author:** ![kdheepak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kdheepak/32/10881_2.png) [@kdheepak](https://discourse.julialang.org/u/kdheepak)\
**Post date:** [June 17, 2022, 9:09pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/10 "2022-06-17T21:09:11Z")

</div>

This is another feature I find myself using in `ipython` from time to time.

 ![Screen Shot 2022-06-17 at 3.08.24 PM](https://global.discourse-cdn.com/julialang/original/3X/e/c/ec3b9376118e75ed64e1aefc994446d548092d66.png)

Is this something that could easily be added to OhMyREPL?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 17, 2022, 9:12pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/11 "2022-06-17T21:12:05Z")

</div>

Yes, but that means you will hold on to all objects that was returned and they will not get GCed. Does Ipython really do that?

---

<div class="post-metadata">

**Author:** ![kdheepak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kdheepak/32/10881_2.png) [@kdheepak](https://discourse.julialang.org/u/kdheepak)\
**Post date:** [June 17, 2022, 9:13pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/12 "2022-06-17T21:13:50Z")

</div>

Yeah it seems like it does:

 ![Screen Shot 2022-06-17 at 3.13.11 PM](https://global.discourse-cdn.com/julialang/original/3X/6/4/64930e7a72975d6db484e1a62d1fc06d5f2cfc32.png)

---

<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:** [June 18, 2022, 12:39pm UTC](https://discourse.julialang.org/t/discussion-on-improving-julia-repl-for-beginners/82933/13 "2022-06-18T12:39:26Z")

</div>

That is available in IJulia as well
