Merge pull request #5665 from edolstra/repl-reset-terminal

nix repl: Reset the terminal on exceptional exits
This commit is contained in:
Eelco Dolstra 2021-11-26 14:21:04 +01:00 committed by GitHub
commit 55275fcc59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();