]> granicus.if.org Git - procps-ng/commitdiff
watch: halt screen at exit on error
authorSami Kerola <kerolasa@iki.fi>
Wed, 4 Jan 2012 19:11:33 +0000 (20:11 +0100)
committerCraig Small <csmall@enc.com.au>
Wed, 4 Jan 2012 22:58:24 +0000 (09:58 +1100)
This change allows user to see what was the last message before exit
on error, and when where the last update.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
watch.c

diff --git a/watch.c b/watch.c
index a6ad22e7d57279833ead25e9b63e5981b0ac16d0..769ce3cf1f52b503263e4b0de9b4f11f682daba3 100644 (file)
--- a/watch.c
+++ b/watch.c
@@ -689,11 +689,14 @@ int main(int argc, char *argv[])
                        if (option_beep)
                                beep();
                        if (option_errexit) {
+                               mvaddstr(height - 1, 0,
+                                        _("Command exit with a non-zero status. Press a key to exit."));
+                               refresh();
+                               fgetc(stdin);
                                endwin();
                                exit(8);
                        }
                }
-
                first_screen = 0;
                refresh();
                if (precise_timekeeping) {