Skip to content

REPL: show user loaded packages in the banner #58366

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

IanButterworth
Copy link
Member

I think it would be helpful to inform the user what was automatically loaded by startup.jl (or by -ie "using Foo" but less useful)

% ./julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.13.0-DEV.563 (2025-05-09)
 _/ |\__'_|_|_|\__'_|  |  Commit 6180ca0e53* (0 days old master)
|__/                   |  Loaded packages: Revise, SimpleLooper

julia>

In particular it's helpful to be reminded whether Revise is loaded when working between multiple machines.

@IanButterworth IanButterworth added the REPL Julia's REPL (Read Eval Print Loop) label May 9, 2025
loaded_modules_string = ""
else
loaded_modules_string = "Loaded packages: $(join(loaded_user_models, ", "))"
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if I put OmniPackage's direct and indirect dependencies in my startup.jl? Do you still like the outcome?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Good point. I think it's reasonable for this to just truncate with ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-05-09 at 11 29 51 AM

Note that Pkg and REPL are in this list because they were loaded as user packages via -ie "using REPL, Pkg" rather than the typical require_stdlib way.

@Keno
Copy link
Member

Keno commented May 9, 2025

If the point is for people to know if Revise is loaded, why not have Revise modify the julia prompt to provide a small unobtrusive indicator, e.g. ⟳ julia> on the REPL prompt? That way you don't even have to scroll up. I don't know if the full list of loaded packages is a useful thing in general to always print.

@IanButterworth
Copy link
Member Author

Julia + Revise

juliar>

More seriously..

julia≥

Or a different green? That's a bit too subtle perhaps. Maybe underline?

A prefix like you suggest might be ok. We do that in Pkg already..

@timholy
Copy link
Member

timholy commented May 9, 2025

@Keno, that's a really good idea.

@IanButterworth
Copy link
Member Author

IanButterworth commented May 9, 2025

My browser font was so small I didn't realize your suggestion was an arrow circle. Yeah I like that.
Some arrow circle chars might be more obvious. Needs testing. I can look into what's needed for Revise & REPL to support this

⟳ julia>
↻ julia> 

@giordano
Copy link
Contributor

giordano commented May 9, 2025

Wouldn't that break copy-pasting terminal output? Given how much Revise is popular, that'd cause inconvenience to many users.

@Keno
Copy link
Member

Keno commented May 9, 2025

The REPL pasting code is robust to changes in the prompt (that's how copy/pasting non-standard REPL modes works). I don't know if it's robust to prefix changes outside of the Pkg mode, but I'm sure it could be adjusted.

@IanButterworth
Copy link
Member Author

That could be fixed for the version it lands on, but yeah, not backwards compatible which might be blocker.

Screenshot 2025-05-09 at 12 10 00 PM

@timholy
Copy link
Member

timholy commented May 9, 2025

I guess we could safely do a color-only change. Say blue instead of green?

@KristofferC
Copy link
Member

Blue is Pkg mode.

@IanButterworth
Copy link
Member Author

Underline?

Screenshot 2025-05-09 at 12 50 17 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants