Export from REPL history to julia script?

Is it possible to save the REPL history as a valid julia script?

Something like:

> a = 3
3
> b = 5
5
> a + b 
8
> REPL.save("myscript.jl")

myscript.jl:

# REPL history export
# Date: 16.04.2021
a = 3
# 3
b = 5
# 5
a + b 
# 8

something like this is possible in iPython

Isn’t the history file (.julia/logs/repl_history.jl) already a valid julia script?

2 Likes

It is, but doesn’t contain any outputs.

2 Likes

Well, if it is not doable from the default repl if OhMyRepl.jl, you can probably just use the IJulia kernel inside iPython.

Edit: yup found it in IJulia docs. ipython3 console --kernel julia-1.5