From: Ɓukasz Stelmach Date: Thu, 2 Mar 2017 12:22:01 +0000 (+0100) Subject: cli/new: Avoid printing "\033[K" to non-terminal output X-Git-Tag: 0.25_rc0~127 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=3071fc04fbf3c43f18291cb8e61b566cdf85d762;ds=sidebyside cli/new: Avoid printing "\033[K" to non-terminal output --- diff --git a/notmuch-new.c b/notmuch-new.c index 13212639..e2822e23 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -905,10 +905,9 @@ print_results (const add_files_state_t *state) state->processed_files == 1 ? "file" : "total files"); notmuch_time_print_formatted_seconds (elapsed); if (elapsed > 1) - printf (" (%d files/sec.).\033[K\n", + printf (" (%d files/sec.)", (int) (state->processed_files / elapsed)); - else - printf (".\033[K\n"); + printf (".%s\n", (state->output_is_a_tty) ? "\033[K" : ""); } if (state->added_messages)