From ad0dd359b4434db84bf6458715440cc15f896ddc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 6 Sep 2013 13:20:35 +0200 Subject: [PATCH] Don't exit on SIGINT during evaluation However, this may leave thunks in black-holed state, so it's not really safe. --- nix-repl.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nix-repl.cc b/nix-repl.cc index bb18359c1..45d743339 100644 --- a/nix-repl.cc +++ b/nix-repl.cc @@ -123,6 +123,8 @@ void NixRepl::mainLoop() processLine(removeWhitespace(line)); } catch (Error & e) { printMsg(lvlError, e.msg()); + } catch (Interrupted & e) { + printMsg(lvlError, e.msg()); } std::cout << std::endl; @@ -176,6 +178,7 @@ void NixRepl::addAttrsToScope(Value & attrs) state.forceAttrs(attrs); foreach (Bindings::iterator, i, *attrs.attrs) addVarToScope(i->name, i->value); + printMsg(lvlError, format("added %1% variables") % attrs.attrs->size()); }