repl: clear the interrupt before reading the next line

Otherwise, it will be thrown again during exit when the repl is terminated by
end-of-input after the last command was interrupted.

Change-Id: I8456c47bc36cfb0892efdad5420f318f7e6526d5
This commit is contained in:
alois31 2024-05-12 16:24:34 +02:00
parent 914b0febf7
commit eeb7e71810
No known key found for this signature in database
GPG key ID: E0F59EA5E5216914

View file

@ -262,6 +262,8 @@ ReplExitStatus NixRepl::mainLoop()
std::string input;
while (true) {
_isInterrupted = false;
// When continuing input from previous lines, don't print a prompt, just align to the same
// number of chars as the prompt.
if (!interacter->getLine(input, input.empty() ? ReplPromptType::ReplPrompt : ReplPromptType::ContinuationPrompt)) {
@ -424,8 +426,6 @@ ProcessLineResult NixRepl::processLine(std::string line)
if (line.empty())
return ProcessLineResult::PromptAgain;
_isInterrupted = false;
std::string command, arg;
if (line[0] == ':') {