1 local LN
= require('linenoise')
5 local history_loaded
= false
6 local history_file
= os
.getenv("HOME") .. "/.mal-history"
10 function M
.readline(prompt
)
11 if not history_loaded
then
14 for line
in io
.lines(history_file
) do
18 return true -- ignore the error
23 io
.write(prompt
); io
.flush();
26 line
= LN
.linenoise(prompt
)
31 local f
= io
.open(history_file
, "a")
35 return true -- ignore the error