Check that the stdout is connected to an interactive terminal with
isatty() before installing the periodic timer to print progress reports.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
#include "notmuch-client.h"
+#include <unistd.h>
+
static volatile sig_atomic_t do_add_files_print_progress = 0;
static void
}
/* Setup our handler for SIGALRM */
- if (! debugger_is_active ()) {
+ if (isatty (fileno (stdout)) && ! debugger_is_active ()) {
memset (&action, 0, sizeof (struct sigaction));
action.sa_handler = handle_sigalrm;
sigemptyset (&action.sa_mask);