aboutsummaryrefslogtreecommitdiff
path: root/src/nix/repl.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-11-26 13:10:28 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-11-26 13:10:28 +0100
commit3ef66cd23a81ae809bee8c27c0d65c3699be5c66 (patch)
tree416ff94ac006e345aa50d49847368350adb84656 /src/nix/repl.cc
parentb653fb9ccf2805f98b9777baec9cd4908f03bb3d (diff)
nix repl: Reset the terminal on exceptional exits
Diffstat (limited to 'src/nix/repl.cc')
-rw-r--r--src/nix/repl.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nix/repl.cc b/src/nix/repl.cc
index 22a57de60..2649eb0bd 100644
--- a/src/nix/repl.cc
+++ b/src/nix/repl.cc
@@ -279,6 +279,7 @@ bool NixRepl::getLine(string & input, const std::string &prompt)
};
setupSignals();
+ Finally resetTerminal([&]() { rl_deprep_terminal(); });
char * s = readline(prompt.c_str());
Finally doFree([&]() { free(s); });
restoreSignals();