aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r--src/libcmd/repl.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index e3afb1531..57848a5d3 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -252,7 +252,9 @@ void NixRepl::mainLoop()
el_hist_size = 1000;
#endif
read_history(historyFile.c_str());
+ auto oldRepl = curRepl;
curRepl = this;
+ Finally restoreRepl([&] { curRepl = oldRepl; });
#ifndef READLINE
rl_set_complete_func(completionCallback);
rl_set_list_possib_func(listPossibleCallback);
@@ -1024,6 +1026,8 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m
str << v.fpoint;
break;
+ case nThunk:
+ case nExternal:
default:
str << ANSI_RED "«unknown»" ANSI_NORMAL;
break;