Halp! I accidentally deleted my ~/.julia/logs folder.
BUT the good news is I have several running julia sessions up, which seem to have some memory of the julia REPL history.
Does anyone know if there's a way to reverse-dump a history file from the running julia process's state somehow? Many thanks in advance!
This should store it back to a file which can then be put in .julia/logs/repl_history.jl:
function restore_repl_history()
hist = Base.active_repl.interface.modes[1].hist
open("restored_history.jl", "w") do io
for (mode, cont) in zip(hist.modes, hist.history)
println(io, "# time: $(Libc.strftime("%Y-%m-%d %H:%M:%S %Z", time()))")
println(io, "# mode: $mode")
s = join(split(cont, '\n'), "\n\t")
println(io, "\t", s)
end
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With