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.
This commit is contained in:
parent
98c8dc5b7d
commit
121d7850fe
6
sdn.cpp
6
sdn.cpp
@ -865,6 +865,12 @@ fun run_program (initializer_list<const char*> list, const string &filename) {
|
|||||||
if (WSTOPSIG (status) == SIGTSTP)
|
if (WSTOPSIG (status) == SIGTSTP)
|
||||||
kill (child, SIGCONT);
|
kill (child, SIGCONT);
|
||||||
tcsetpgrp (STDOUT_FILENO, getpgid (0));
|
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 ();
|
refresh ();
|
||||||
|
Loading…
Reference in New Issue
Block a user