Skip to content

Commit 2a0d28c

Browse files
show user loaded packages in the banner
1 parent 6180ca0 commit 2a0d28c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

stdlib/REPL/src/REPL.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,15 @@ function banner(io::IO = stdout; short = false)
17321732
end
17331733
end
17341734

1735+
loaded_user_modules = filter(names(Main,imported=true)) do m
1736+
typeof(getfield(Main, m)) <: Module && m (:Base, :Core, :Main)
1737+
end
1738+
if isempty(loaded_user_modules)
1739+
loaded_modules_string = ""
1740+
else
1741+
loaded_modules_string = "Loaded packages: $(join(loaded_user_models, ", "))"
1742+
end
1743+
17351744
commit_date = isempty(Base.GIT_VERSION_INFO.date_string) ? "" : " ($(split(Base.GIT_VERSION_INFO.date_string)[1]))"
17361745

17371746
if get(io, :color, false)::Bool
@@ -1756,7 +1765,7 @@ function banner(io::IO = stdout; short = false)
17561765
$(jl)| | | | | | |/ _` |$(tx) |
17571766
$(jl)| | |_| | | | (_| |$(tx) | Version $(VERSION)$(commit_date)
17581767
$(jl)_/ |\\__'_|_|_|\\__'_|$(tx) | $(commit_string)
1759-
$(jl)|__/$(tx) |
1768+
$(jl)|__/$(tx) | $(loaded_modules_string)
17601769
17611770
""")
17621771
end

0 commit comments

Comments
 (0)