about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nix/repl.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nix/repl.cc b/src/nix/repl.cc
index 39c6520999c0..d93fd770e807 100644
--- a/src/nix/repl.cc
+++ b/src/nix/repl.cc
@@ -5,7 +5,12 @@
 
 #include <setjmp.h>
 
+#ifdef READLINE
+#include <readline/history.h>
+#include <readline/readline.h>
+#else
 #include <editline.h>
+#endif
 
 #include "shared.hh"
 #include "eval.hh"
@@ -202,11 +207,15 @@ void NixRepl::mainLoop(const std::vector<std::string> & 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());
     curRepl = this;
+#ifndef READLINE
     rl_set_complete_func(completionCallback);
     rl_set_list_possib_func(listPossibleCallback);
+#endif
 
     std::string input;