From a121afbf7fc17e78435eed890cfb76f58b2e93e1 Mon Sep 17 00:00:00 2001 From: dongwlin Date: Wed, 11 Dec 2024 16:27:21 +0800 Subject: [PATCH] fix: tasks input error --- source/cli/tasks.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/cli/tasks.cpp b/source/cli/tasks.cpp index 807ceb6..b80a509 100644 --- a/source/cli/tasks.cpp +++ b/source/cli/tasks.cpp @@ -26,7 +26,9 @@ bool select_tasks(std::vector& tasklist) std::vector task_ids; std::string line; - std::cin.ignore(); + if (std::cin.rdbuf()->in_avail() > 0) { + std::cin.ignore(std::numeric_limits::max(), '\n'); + } std::getline(std::cin, line); std::istringstream iss(line);