[PATCH] Add completion styling

Hannes Domani ssbssa@yahoo.de
Sun May 24 00:26:05 GMT 2020


 Am Samstag, 23. Mai 2020, 22:53:10 MESZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben:

> >>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
>
> Tom> I think the Emacs idea is nice.  Maybe we want to let the user control
> Tom> the prefix text, the "difference character", and the final completion
> Tom> text.
>
> > Here's a new version of the patch that implements this idea.
>
> I'm checking this in.

I just tried it out on Windows.
It works fine in TUI, but in the CLI it just prints the escape sequences:

(gdb) b
?[2mb?[m?[35ma?[mcktrace    ?[2mb?[m?[35mo?[mokmark     ?[2mb?[m?[35mr?[meak
    ?[2mb?[m?[35mr?[meak-range  ?[2mb?[m?[35mt?[m

Once I added the same gdb_console_fputs call for cli_mld_puts as
stdio_file::puts has, the problem was gone:

diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index e47272ad87..1ddc80811b 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -339,6 +339,8 @@ cli_mld_putch (const struct match_list_displayer *displayer, int ch)
 static void
 cli_mld_puts (const struct match_list_displayer *displayer, const char *s)
 {
+  if (gdb_console_fputs (s, rl_outstream))
+    return;
   fputs (s, rl_outstream);
 }


Hannes


More information about the Gdb-patches mailing list