diff --git a/src/nix/repl.cc b/src/nix/repl.cc index ff8477865..d93fd770e 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -5,7 +5,12 @@ #include +#ifdef READLINE +#include +#include +#else #include +#endif #include "shared.hh" #include "eval.hh" @@ -202,13 +207,15 @@ void NixRepl::mainLoop(const std::vector & files) // Allow nix-repl specific settings in .inputrc rl_readline_name = "nix-repl"; createDirs(dirOf(historyFile)); +#ifndef READLINE el_hist_size = 1000; +#endif read_history(historyFile.c_str()); - // rl_initialize(); - // linenoiseSetCompletionCallback(completionCallback); curRepl = this; +#ifndef READLINE rl_set_complete_func(completionCallback); rl_set_list_possib_func(listPossibleCallback); +#endif std::string input;