And hide Julia initial info too, so the repl will be nice and clean.
# Set the prompt using environment variable
ENV["JULIA_PROMPT"] = "> "
# Also try the REPL approach as backup
using REPL
if isinteractive()
atreplinit() do repl
try
repl.interface = REPL.setup_interface(repl)
repl.interface.modes[1].prompt = "> "
catch
# If this fails, the environment variable should still work
end
end
end
-
Shell environment variable: JULIA_PROMPT="> " in your ~/.zshrc
-
Alias for splash screen: julia --quiet --banner=no
Thanks, I tried JULIA_PROMPT
but seems like it doesn’t work? (the second approach doesn’t work ether).
bash> echo $JULIA_PROMPT
>
bash> julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.11.4 (2025-03-10)
_/ |\__'_|_|_|\__'_| | Built by Homebrew (v1.11.4)
|__/ |
julia> "Hi"
"Hi"
julia> ENV["JULIA_PROMPT"] = "> "
"> "
julia> "Hi"
"Hi"
julia>
That’s because dummy here left out the part of the startup.jl file
# Set the prompt using environment variable
ENV["JULIA_PROMPT"] = "> "
# Also try the REPL approach as backup
using REPL
if isinteractive()
atreplinit() do repl
try
repl.interface = REPL.setup_interface(repl)
repl.interface.modes[1].prompt = "> "
catch
# If this fails, the environment variable should still work
end
end
end
This goes in your ~/.julia/config directory
Home · OhMyREPL does that plus a bunch more.
Thanks, adding it to ~/.julia/config/startup.jl
solved the prmpt.
As for removing the banner - isn’t there any config/env option to supress it? adding --quiet
is not convenient
Didn’t find one, but
alias julia="julia --quiet --banner=no"
in .zshrc
is a problem?
Thanks, yes that’s reasonable solution.
To add on to @Joris_Pinkse, changing the prompt is a dedicated example as well.
OhMyREPL.input_prompt!("> ", :magenta)
OhMyREPL.output_prompt!("> ", :red)
Additionally,
If the first argument instead is a function, it will be run every time the prompt wants to update which allows for more dynamic behavior.