From 99a3388e41a434a15a778f5e0e46202d3fa0e719 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 30 Nov 2016 13:46:20 +0000 Subject: [PATCH] Hide the waiting for shell message once the shell returns --- src/shell_manager.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/shell_manager.cc b/src/shell_manager.cc index 698c7fc70..81df87ee0 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -191,6 +191,7 @@ std::pair ShellManager::eval( using namespace std::chrono; static constexpr seconds wait_timeout{1}; + bool wait_notified = false; Timer wait_timer{wait_time + wait_timeout, [&](Timer& timer) { auto wait_duration = Clock::now() - wait_time; @@ -198,6 +199,7 @@ std::pair ShellManager::eval( duration_cast(wait_duration).count()), get_face("Information") }, true); timer.set_next_date(Clock::now() + wait_timeout); + wait_notified = true; }, EventMode::Urgent}; while (not terminated or @@ -222,6 +224,9 @@ std::pair ShellManager::eval( (size_t)full.count(), (size_t)spawn.count(), (size_t)wait.count())); } + if (wait_notified) // clear the status line + context.print_status({ "", get_face("Information") }, true); + return { stdout_contents, WIFEXITED(status) ? WEXITSTATUS(status) : -1 }; }