diff options
-rw-r--r-- | src/Readline.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Readline.cc b/src/Readline.cc index ad324ee..9a2c791 100644 --- a/src/Readline.cc +++ b/src/Readline.cc @@ -6,7 +6,9 @@ using namespace Balau; Readline::Readline(const String & program, IO<Handle> in) : m_in(in) { + HistEvent ev; m_hist = history_init(); + history(m_hist, &ev, H_SETSIZE, 5000); m_el = el_init(program.to_charp(), stdin, stdout, stderr); el_set(m_el, EL_CLIENTDATA, this); el_set(m_el, EL_PROMPT, (const char * (*)(EditLine *)) &Readline::elPrompt); @@ -33,6 +35,11 @@ String Readline::gets() { return ""; } + if (*line) { + HistEvent ev; + history(m_hist, &ev, H_ENTER, line); + } + return line; } |