Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia REPL should show environment name inline #54235

Open
kdheepak opened this issue Apr 24, 2024 · 0 comments
Open

Julia REPL should show environment name inline #54235

kdheepak opened this issue Apr 24, 2024 · 0 comments

Comments

@kdheepak
Copy link
Contributor

Currently, without any changes to startup.jl, running julia from the command activates the root environment. I think this is a poor UX but it exists for safety reasons ( we don't want julia -e "using Foo" to load arbitrary malicious code ).

In internal documentation, I've recommended using julia --project=. as the default way new users should start a REPL.

Screenshot 2024-04-24 151916

But it can be easy to fat finger this and you can end up nesting levels a folder level. Here's an example I've seen people do accidentally:

Screenshot 2024-04-24 152357

Here's another screenshot I took of a colleague's computer from this morning, where they forgot to add a . in @.:

Screenshot 2024-04-24 114725

I think if the prompt has some indication of what the environment was, it would have been more clear to my colleague without me intervening. I've seen new users run into this issue enough times that I think it is worth making some UX change to the Julia REPL to improve the situation.

I particularly like how in conda, the environment is always listed as part of the shell:

(base) C:\Users\USERNAME\gitrepos\empty-new-folder>conda activate projectx

(projectx) C:\Users\USERNAME\gitrepos\empty-new-folder>

We don't have to go that far as to make the shell aware of Julia but making a prompt inside the Julia REPL more user friendly would be an improvement imho.

If we wanted to preserve space, we can leave the display as is for shorter terminal widths but with wider terminals are available, we can print the environment name on the right hand side. e.g.:

julia>                                         <(projectx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant