Is there an easy way to get at the history of REPL input?

PetrKryslUCSD/REPLHistory.jl: Gain access to the Julia REPL history. (github.com)

$ ~/AppData/Local/Programs/Julia-1.5.3/bin/julia.exe
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.3 (2020-11-09)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using REPLHistory

shell> ls
'3D Objects'
 AppData
'Application Data'
 Contacts
 Cookies
 Documents
 Downloads
 Favorites
...

(@v1.5) pkg> status
Status `C:\Users\pkonl\.julia\environments\v1.5\Project.toml`
  [a5566ce3] REPLHistory v0.1.0

julia> pwd()
"C:\\Users\\pkonl"

julia> print(history())
using REPLHistory
;ls
]status
pwd()

julia>

I wish I could have more confidence in Base.active_repl.mistate.current_mode.hist.history, but it looks alarmingly “internal”.

3 Likes