This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 06/16] Reset terminal styles
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 24 Dec 2018 08:16:05 +0400
- Subject: Re: [PATCH 06/16] Reset terminal styles
- References: <20181128001435.12703-1-tom@tromey.com> <20181128001435.12703-7-tom@tromey.com>
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 <tom@tromey.com>
>
> * 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