Use readline history file
This commit is contained in:
parent
4fb82d3d80
commit
0b419c048b
|
@ -71,7 +71,10 @@ bool getLine(string & line)
|
|||
if (!s) return false;
|
||||
line = chomp(string(s));
|
||||
free(s);
|
||||
if (line != "") add_history(line.c_str());
|
||||
if (line != "") {
|
||||
add_history(line.c_str());
|
||||
append_history(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
_isInterrupted = 0;
|
||||
|
@ -109,6 +112,9 @@ void NixRepl::mainLoop()
|
|||
{
|
||||
std::cerr << "Welcome to Nix version " << NIX_VERSION << ". Type :? for help." << std::endl << std::endl;
|
||||
|
||||
using_history();
|
||||
read_history(0);
|
||||
|
||||
while (true) {
|
||||
string line;
|
||||
if (!getLine(line)) break;
|
||||
|
|
Loading…
Reference in a new issue