From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id A3AC16DE1D53 for ; Thu, 9 Mar 2017 05:51:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7mdqo4loRuWl for ; Thu, 9 Mar 2017 05:51:45 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id BEAB76DE19D7 for ; Thu, 9 Mar 2017 05:51:45 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1clyTA-0001qt-8J for notmuch@notmuchmail.org; Thu, 09 Mar 2017 08:51:04 -0500 Received: (nullmailer pid 16104 invoked by uid 1000); Thu, 09 Mar 2017 13:51:43 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [David Bremner] Re: [PATCH] cli/new: Avoid printing "\033[K" to non-terminal output X-List-To: notmuch Date: Thu, 09 Mar 2017 09:51:43 -0400 Message-ID: <87zigu4ky8.fsf@tethera.net> MIME-Version: 1.0 Content-Type: message/rfc822 Content-Disposition: inline X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Mar 2017 13:51:46 -0000 From: David Bremner To: =?utf-8?Q?=C5=81ukasz?= Stelmach Subject: Re: [PATCH] cli/new: Avoid printing "\033[K" to non-terminal output In-Reply-To: <1488457321-24449-1-git-send-email-l.stelmach@samsung.com> References: <1488457321-24449-1-git-send-email-l.stelmach@samsung.com> Date: Thu, 09 Mar 2017 08:35:11 -0400 Message-ID: <87bmta6328.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =C5=81ukasz Stelmach writes: > --- > 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 =3D=3D 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" : ""); > } Other than missing a space after printf (which I can hopefully remember to add when I commit it, this looks fine). d