aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
diff options
context:
space:
mode:
authorAlois Wohlschlager <alois1@gmx-topmail.de>2024-05-12 16:24:34 +0200
committerAlois Wohlschlager <alois1@gmx-topmail.de>2024-05-13 09:04:05 +0200
commiteeb7e718101fbc5c53d3e070d8987e468047d804 (patch)
tree63672ce7e4c79e7df98934079e491fff90dce5a2 /src/libcmd/repl.cc
parent914b0febf77c91ae7f20d098f62a5feefc1acdc3 (diff)
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
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r--src/libcmd/repl.cc4
1 files changed, 2 insertions, 2 deletions
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] == ':') {