Re: [PATCH 00/16] Add styling to the gdb CLI and TUI

Tom Tromey
2018-11-29T22:44:04Z

>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

Eli> Will the Windows TUI build support styling out of the box? It uses
Eli> ncurses.

I think it should work, but you'd have to "set style enabled on" first.

Eli> And I don't think I understand what you mean by "filter escape
Eli> sequences from the output". Where (on what level) would such filter
Eli> be installed, given that output is written directly to the console?

I think either utils.c would have to be modified to change where it
sends output, or stdio_file::puts would have to be modified. The idea
there would be to call a host-specific function; and then on Windows do
the filtering+styling if the output is going to the terminal.

Eli> I see that you introduced the emit_style_escape function that switches
Eli> styles. What I don't think I understand is whether it will work to
Eli> have a Windows implementation of that that calls a function which
Eli> causes the text output after that to use given colors? It seems it
Eli> will, because the code calls emit_style_escape before and after each
Eli> string, but I cannot be sure.

Doing it that way can't work due to buffering. Also, this approach
would be undesirable anyway, because GNU Source Highlight emits escape
codes -- that's why I abandoned my earlier plan of implementing styling
as objects in the utils.c buffer. Instead, I think filtering the escape
sequences is really the only way.

Tom