summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-07-24 09:18:08 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-07-24 09:18:08 +0200
commitd625e8c12de02e2c39d687b735e6e8d5a3fd0865 (patch)
tree6d22d6606847e1aa951734f24c9a43ac0cfd40b3 /src
parent962a8482da0eaaf4c50fd558c44b504705a7845b (diff)
Actually adding history this time.
Diffstat (limited to 'src')
-rw-r--r--src/Readline.cc7
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;
}