diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2020-09-28 20:04:52 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2020-09-28 20:05:29 +0200 |
commit | 121d7850fead25bc0cb2dd14b11d7db29d0498ee (patch) | |
tree | 82b1dfa505e4dcd772e5cfb522419dfb830a2eb4 | |
parent | 98c8dc5b7d43892cfb0d5d4c1ec5eca0ed7ffd49 (diff) | |
download | sdn-121d7850fead25bc0cb2dd14b11d7db29d0498ee.tar.gz sdn-121d7850fead25bc0cb2dd14b11d7db29d0498ee.tar.xz sdn-121d7850fead25bc0cb2dd14b11d7db29d0498ee.zip |
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.
-rw-r--r-- | sdn.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -865,6 +865,12 @@ fun run_program (initializer_list<const char*> 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 (); |