Reset terminal styles
authorTom Tromey <tom@tromey.com>
Sat, 17 Nov 2018 18:49:25 +0000 (11:49 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 28 Dec 2018 19:49:49 +0000 (12:49 -0700)
commitef1dfa3644f02efffa11d718fe5788c05177587b
tree8c1591c01d1019356b0d76e142e3fe2091c6c550
parentcbe5657196d0d3acbeca39973f93f333ecedacda
Reset terminal styles

This adds a function that can be used to reset terminal styles,
regardless of what style the low-level output routines currently think
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-12-28  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.
gdb/ChangeLog
gdb/cli/cli-cmds.c
gdb/printcmd.c
gdb/utils.c
gdb/utils.h