aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-11-26 14:21:04 +0100
committerGitHub <noreply@github.com>2021-11-26 14:21:04 +0100
commit55275fcc5966cfad80fb6dc77b8d8939a2f1b8e0 (patch)
tree416ff94ac006e345aa50d49847368350adb84656
parentb653fb9ccf2805f98b9777baec9cd4908f03bb3d (diff)
parent3ef66cd23a81ae809bee8c27c0d65c3699be5c66 (diff)
Merge pull request #5665 from edolstra/repl-reset-terminal
nix repl: Reset the terminal on exceptional exits
-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();