Skip to content

Commit

Permalink
fix: tasks input error
Browse files Browse the repository at this point in the history
  • Loading branch information
dongwlin committed Dec 11, 2024
1 parent 3b7029f commit a121afb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/cli/tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ bool select_tasks(std::vector<Task>& tasklist)
std::vector<int> task_ids;
std::string line;

std::cin.ignore();
if (std::cin.rdbuf()->in_avail() > 0) {
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
std::getline(std::cin, line);

std::istringstream iss(line);
Expand Down

0 comments on commit a121afb

Please sign in to comment.