summaryrefslogtreecommitdiffstats
path: root/sinksh/repl/repl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sinksh/repl/repl.cpp')
-rw-r--r--sinksh/repl/repl.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/sinksh/repl/repl.cpp b/sinksh/repl/repl.cpp
index 21209fc..32932cb 100644
--- a/sinksh/repl/repl.cpp
+++ b/sinksh/repl/repl.cpp
@@ -19,8 +19,6 @@
19 19
20#include "repl.h" 20#include "repl.h"
21 21
22#include <readline/history.h>
23
24#include <QDir> 22#include <QDir>
25#include <QFile> 23#include <QFile>
26#include <QFinalState> 24#include <QFinalState>
@@ -29,13 +27,12 @@
29 27
30#include "replStates.h" 28#include "replStates.h"
31#include "syntaxtree.h" 29#include "syntaxtree.h"
30#include "linenoise.hpp"
32 31
33Repl::Repl(QObject *parent) 32Repl::Repl(QObject *parent)
34 : QStateMachine(parent) 33 : QStateMachine(parent)
35{ 34{
36 // readline history setup 35 linenoise::LoadHistory(commandHistoryPath().toLocal8Bit());
37 using_history();
38 read_history(commandHistoryPath().toLocal8Bit());
39 36
40 // create all states 37 // create all states
41 ReadState *read = new ReadState(this); 38 ReadState *read = new ReadState(this);
@@ -64,8 +61,7 @@ Repl::Repl(QObject *parent)
64 61
65Repl::~Repl() 62Repl::~Repl()
66{ 63{
67 // readline history writing 64 linenoise::SaveHistory(commandHistoryPath().toLocal8Bit());
68 write_history(commandHistoryPath().toLocal8Bit());
69} 65}
70 66
71void Repl::printWelcomeBanner() 67void Repl::printWelcomeBanner()