From 0baf562c93670d90369ef99828bccc94a9d92520 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 30 Mar 2018 09:58:18 +1100 Subject: Support full redraws during shell execution and handle resize there Fixes #1973 --- src/shell_manager.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/shell_manager.cc') diff --git a/src/shell_manager.cc b/src/shell_manager.cc index 11d2b0cc..47bfd101 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -1,6 +1,7 @@ #include "shell_manager.hh" #include "buffer_utils.hh" +#include "client.hh" #include "clock.hh" #include "context.hh" #include "display_buffer.hh" @@ -259,9 +260,14 @@ std::pair ShellManager::eval( Timer wait_timer{wait_time + wait_timeout, [&](Timer& timer) { auto wait_duration = Clock::now() - wait_time; - context.print_status({ format("waiting for shell command to finish ({}s)", - duration_cast(wait_duration).count()), - get_face("Information") }, true); + if (context.has_client()) + { + auto& client = context.client(); + client.print_status({ format("waiting for shell command to finish ({}s)", + duration_cast(wait_duration).count()), + get_face("Information") }); + client.redraw_ifn(); + } timer.set_next_date(Clock::now() + wait_timeout); wait_notified = true; }, EventMode::Urgent}; @@ -288,8 +294,11 @@ 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({}, true); + if (wait_notified and context.has_client()) // clear the status line + { + context.print_status({}); + context.client().redraw_ifn(); + } return { std::move(stdout_contents), WIFEXITED(status) ? WEXITSTATUS(status) : -1 }; } -- cgit v1.2.3