One of the benefits of Julia is its ultra-flexibility. This is very easy in Julia 0.7 (nightly version).
julia> repl = Base.active_repl.interface.modes[1] "Prompt(\"julia> \",...)" julia> repl.prompt = () -> "julia[$(length(repl.hist.history) - repl.hist.start_idx + 1)] >" #1 (generic function with 1 method) julia[3] > julia[3] >2 2 julia[4] >f = () -> error("e") #3 (generic function with 1 method) julia[5] >f() ERROR: e Stacktrace: [1] error at .\error.jl:33 [inlined] [2] (::getfield(, Symbol("##3#4")))() at .\REPL[4]:1 [3] top-level scope
You just need to put the first 2 lines on your ~/.juliarc and enjoy ~
Since there are several changes in REPL after julia 0.7, these codes do not work in older versions.
EDIT: Well, it actually takes a little more effort for it to work in .juliarc.jl . Try this code:
atreplinit() do repl repl.interface = Base.REPL.setup_interface(repl) repl = Base.active_repl.interface.modes[1] repl.prompt = () -> "julia[$(length(repl.hist.history) - repl.hist.start_idx + 1)] >" end
source share