From: "Łukasz Stelmach" <l.stelmach@samsung.com>
To: notmuch@notmuchmail.org
Cc: "Łukasz Stelmach" <l.stelmach@samsung.com>
Subject: [PATCH] cli/new: Avoid printing "\033[K" to non-terminal output
Date: Thu, 02 Mar 2017 13:22:01 +0100 [thread overview]
Message-ID: <1488457321-24449-1-git-send-email-l.stelmach@samsung.com> (raw)
In-Reply-To: CGME20170302122208eucas1p2dcea0ead891ae5216a5e734a5f079db6@eucas1p2.samsung.com
---
notmuch-new.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/notmuch-new.c b/notmuch-new.c
index 1321263..44174ad 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)
--
2.1.4
next parent reply other threads:[~2017-03-02 12:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170302122208eucas1p2dcea0ead891ae5216a5e734a5f079db6@eucas1p2.samsung.com>
2017-03-02 12:22 ` Łukasz Stelmach [this message]
[not found] ` <87bmta6328.fsf@tethera.net>
2017-03-10 9:21 ` [PATCH] cli/new: Avoid printing "\033[K" to non-terminal output Łukasz Stelmach
2017-03-10 11:44 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1488457321-24449-1-git-send-email-l.stelmach@samsung.com \
--to=l.stelmach@samsung.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).