From eeb7e718101fbc5c53d3e070d8987e468047d804 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Sun, 12 May 2024 16:24:34 +0200 Subject: 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 --- src/libcmd/repl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libcmd') diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 696bb3c12..34de2160a 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -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] == ':') { -- cgit v1.2.3