[RFC 0/8] add terminal styling to gdb
Eli Zaretskii
eliz@gnu.org
Fri Sep 7 06:23:00 GMT 2018
> From: Tom Tromey <tom@tromey.com>
> Date: Thu, 6 Sep 2018 15:12:55 -0600
>
> I've wanted gdb to use colors on the terminal for a while now. I've
> actually tried implementing this a few different ways at different
> times, the most successful approach so far being a colorizing frame
> filter.
>
> This series takes a more direct approach, namely integrating the code
> into gdb. The basic approach is to have gdb know how to emit ANSI
> terminal escape codes to control the color and style (currently just
> the intensity). Then, cli-out is changed to style certain fields as
> it emits them. However, because some places do not use ui-out, some
> ad hoc changes are also done.
This is a worthy goal, IMO, but please allow a level of abstraction
between output styles and ANSI escape sequences. In particular, the
assumption that changing a style or switching text attributes (like
color, bold, etc.) requires to "emit" something to the terminal, is
not necessarily true. Please allow for terminals where doing that
requires a function call that doesn't necessarily write anything to
the terminal.
Another, perhaps alternative possibility, would be to use
curses/ncurses features for controlling text color.
Finally, did you consider the use case of running GDB from Emacs (via
the old GUD, which uses CLI I/O)? Would the color escapes be disabled
in that case, or would that require Emacs to interpret them? Same
question for other front-ends which use CLI, if there are such.
Thanks.
More information about the Gdb-patches
mailing list