From e538e9199c5e78a83d61ca87553852543d661eaf Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Mon, 27 Sep 2021 22:04:10 -0400 Subject: [PATCH] CmdNews: Make it explicit enter has to be pressed to continue --- src/commands/CmdNews.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/CmdNews.cpp b/src/commands/CmdNews.cpp index 6e571c148..0ae9fd6f4 100644 --- a/src/commands/CmdNews.cpp +++ b/src/commands/CmdNews.cpp @@ -61,12 +61,14 @@ static void signal_handler (int s) } } -void wait_for_keypress () +void wait_for_enter () { signal (SIGINT, signal_handler); std::string dummy; + std::cout << "\nPress enter to continue.."; std::getline (std::cin, dummy); + std::cout << "\33[2K\033[A\33[2K"; // Erase current line, move up, and erase again signal (SIGINT, SIG_DFL); } @@ -176,7 +178,7 @@ int CmdNews::execute (std::string& output) for (unsigned short i=0; i < items.size (); i++) { std::cout << format ("\n({1}/{2}) ", i+1, items.size ()); items[i].render (); - wait_for_keypress (); + wait_for_enter (); } // Set a mark in the config to remember which version's release notes were displayed