From 1fd5ff640e21656d482bba356d70af7c019a2caf Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Fri, 27 Aug 2021 15:32:13 +0200 Subject: [PATCH] Added hide and show of cursor --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ac21920..dfa994a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -155,12 +155,17 @@ int main(int argc, const char * argv[]) { unsigned long long cur_iter {robinsonizer.total_iterations()}; unsigned long long prev_iter {0}; + // hide cursor + std::cerr << "\x1b[?25l"; + while (!robinsonizer.found()) { // show progress info prev_iter = cur_iter; std::this_thread::sleep_for(std::chrono::seconds{1}); cur_iter = robinsonizer.total_iterations(); - std::cerr << '\r' << cur_iter - prev_iter << " iterations per second, " << cur_iter << " total "; + std::cerr << '\r' << cur_iter - prev_iter << " iterations per second, " << cur_iter << " total"; } + // show cursor + std::cerr << "\x1b[?25h"; worker.join(); std::cout << '\n'; } else {