diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2013-07-24 09:12:27 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2013-07-24 09:12:27 +0200 |
commit | 962a8482da0eaaf4c50fd558c44b504705a7845b (patch) | |
tree | 03a803ced903538cf3c347737971897392066a87 /src | |
parent | 316b2a40f0bd9ccdf8a2ff2f2e097011cbb5fedf (diff) |
Adding history support to Readline.
Diffstat (limited to 'src')
-rw-r--r-- | src/Readline.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Readline.cc b/src/Readline.cc index a58719d..ad324ee 100644 --- a/src/Readline.cc +++ b/src/Readline.cc @@ -6,15 +6,18 @@ using namespace Balau; Readline::Readline(const String & program, IO<Handle> in) : m_in(in) { + m_hist = history_init(); 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); el_set(m_el, EL_SIGNAL, 1); el_set(m_el, EL_GETCFN, (int (*)(EditLine *, char *)) &Readline::elGetCFN); + el_set(m_el, EL_HIST, history, m_hist); } Readline::~Readline() { el_end(m_el); + history_end(m_hist); } void Readline::setPrompt(const String & prompt) { |