]> granicus.if.org Git - procps-ng/commitdiff
watch: Pass through bell
authorCraig Small <csmall@dropbear.xyz>
Tue, 17 Jan 2023 05:59:00 +0000 (16:59 +1100)
committerCraig Small <csmall@dropbear.xyz>
Tue, 17 Jan 2023 05:59:00 +0000 (16:59 +1100)
Based upon merge request 104, closes #174

References:
 procps-ng/procps!104
 procps-ng/procps#174

NEWS
src/watch.c

diff --git a/NEWS b/NEWS
index 019f1db62f3aa6a3833b93b33500ee784d22aba9..bb664d9a9cf2b5a83cc349d5a433afa4b414c776 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ procps-ng-NEXT
   * top: E/P-core toggle ('5' key) added to help
   * vmstat: Referesh memory statistics                     Debian #1027963
   * w: Add --pids option                                   merge #159
+  * watch: Pass through beep                               issue #104
 
 procps-ng-4.0.2
 ---------------
index a69a402927ff25a468d78e98923e488291ada4b5..c65f69b801f1332ef2a9f4db60264cc770a709a3 100644 (file)
@@ -647,6 +647,7 @@ static int run_command(char *restrict command, char **restrict command_argv)
                                        } while (c != WEOF && !iswprint(c)
                                                 && c < 128
                                                 && wcwidth(c) == 0
+                                                 && c != L'\a'
                                                 && c != L'\n'
                                                 && c != L'\t'
                                                 && (c != L'\033'
@@ -655,6 +656,7 @@ static int run_command(char *restrict command, char **restrict command_argv)
                                        do
                                                c = getc(p);
                                        while (c != EOF && !isprint(c)
+                                              && c != '\a'
                                               && c != '\n'
                                               && c != '\t'
                                               && (c != L'\033'
@@ -673,6 +675,10 @@ static int run_command(char *restrict command, char **restrict command_argv)
                                                eolseen = 1;
                                else if (c == L'\t')
                                        tabpending = 1;
+                                else if (c == L'\a') {
+                                    beep();
+                                    continue;
+                                }
 #ifdef WITH_WATCH8BIT
                                if (x == width - 1 && wcwidth(c) == 2) {
                                        y++;