From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74982 invoked by alias); 24 Dec 2018 04:16:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 74972 invoked by uid 89); 24 Dec 2018 04:16:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Dec 2018 04:16:13 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D6C81117125; Sun, 23 Dec 2018 23:16:11 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id t0hEod8okZpt; Sun, 23 Dec 2018 23:16:11 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6969111643D; Sun, 23 Dec 2018 23:16:11 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 5C42B86756; Mon, 24 Dec 2018 08:16:05 +0400 (+04) Date: Mon, 24 Dec 2018 04:16:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 06/16] Reset terminal styles Message-ID: <20181224041605.GI5246@adacore.com> References: <20181128001435.12703-1-tom@tromey.com> <20181128001435.12703-7-tom@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181128001435.12703-7-tom@tromey.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2018-12/txt/msg00293.txt.bz2 Hi Tom, > This adds a function that can be used to reset terminal styles, > regardless of what style the low-levle output routines currently think Typo: levle -> level > is applied. > > This is used to make "echo" and "printf" work properly when emitting > ANSI terminal escapes -- now gdb will reset the style at the end of > the command. > > gdb/ChangeLog > 2018-11-27 Tom Tromey > > * utils.h (reset_terminal_style): Declare. > * utils.c (can_emit_style_escape): New function. > (set_output_style): Use it. > (reset_terminal_style): New function. > * printcmd.c (printf_command): Call reset_terminal_style. > * cli/cli-cmds.c (echo_command): Call reset_terminal_style. OK with me. Just one question below. > diff --git a/gdb/printcmd.c b/gdb/printcmd.c > index 8c999188d7..79c3d2d2ff 100644 > --- a/gdb/printcmd.c > +++ b/gdb/printcmd.c > @@ -2609,6 +2609,8 @@ static void > printf_command (const char *arg, int from_tty) > { > ui_printf (arg, gdb_stdout); > + reset_terminal_style (gdb_stdout); > + wrap_here (""); Can you explain why you added the "wrap_here"? -- Joel