Re: [PATCH] [gdb/cli] Document \001 and \002 usage for set prompt

Eli Zaretskii
2025-07-19T06:47:48Z

> From: Tom de Vries <tdevries@suse.de>
> Date: Sat, 19 Jul 2025 08:16:36 +0200
>
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 35b770f8138..0a2d34756eb 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -27659,6 +27659,16 @@ or a prompt that does not.
> @item set prompt @var{newprompt}
> Directs @value{GDBN} to use @var{newprompt} as its prompt string henceforth.
>
> +For example, this will set a blue-colored ``(gdb)'' prompt:
> +
> +@smallexample
> +set prompt \001\033[0;34m\002(gdb)\001\033[0m\002
> +@end smallexample
> +
> +It uses ``\001'' and ``\002'' to begin and end a sequence of
> +non-printing characters, to make sure they're not counted in the string
> +length.

Please use @samp to quote \001 etc., not literal quotes.

OK with that nit fixed.

P.S. Does this work on MS-Windows console as well?

Approved-By: Eli Zaretskii <eliz@gnu.org>