From 121d7850fead25bc0cb2dd14b11d7db29d0498ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Mon, 28 Sep 2020 20:04:52 +0200 Subject: Show error output from failed helpers Usually, when the pager or the editor fail and return a non-zero exit status, they display a message on the standard error output. We might also try to redirect this output to show_mesage() but it might not fit as a whole, so, given the relative rareness of this situation, this slight inconsistency shouldn't be much of an issue. It'd also be possible to redirect the output to run_pager() but in doing so, we might make the problem recursive. --- sdn.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sdn.cpp') diff --git a/sdn.cpp b/sdn.cpp index b9d18c4..37caf19 100644 --- a/sdn.cpp +++ b/sdn.cpp @@ -865,6 +865,12 @@ fun run_program (initializer_list list, const string &filename) { if (WSTOPSIG (status) == SIGTSTP) kill (child, SIGCONT); tcsetpgrp (STDOUT_FILENO, getpgid (0)); + + if (WIFEXITED (status) && WEXITSTATUS (status)) { + printf ("Helper returned non-zero exit status %d. " + "Press Enter to continue.\n", WEXITSTATUS (status)); + string dummy; getline (cin, dummy); + } } refresh (); -- cgit v1.2.3