mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
notmuch-new: Only print the regular progress report when on a tty
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>
This commit is contained in:
parent
986f6c9824
commit
018ca890a3
1 changed files with 3 additions and 1 deletions
|
@ -20,6 +20,8 @@
|
|||
|
||||
#include "notmuch-client.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
static volatile sig_atomic_t do_add_files_print_progress = 0;
|
||||
|
||||
static void
|
||||
|
@ -273,7 +275,7 @@ add_files (notmuch_database_t *notmuch,
|
|||
}
|
||||
|
||||
/* 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);
|
||||
|
|
Loading…
Reference in a new issue