Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/cli] Document \001 and \002 usage for set prompt
Date: Sat, 19 Jul 2025 18:07:25 +0200	[thread overview]
Message-ID: <31e0fea7-9a20-4c35-9cae-b0f3f8dd20e1@suse.de> (raw)
In-Reply-To: <865xfofzij.fsf@gnu.org>

On 7/19/25 08:47, Eli Zaretskii wrote:
>> 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.
> 

Hi Eli,

thanks for the review, pushed with that nit fixed.

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

A good question.

I suppose the \001\002 part should work, because it's handled by 
readline (assuming readline is always used).

The \033 bits, probably not.  I read this wikipedia article ( 
https://en.wikipedia.org/wiki/ANSI_escape_code ) which has some info on 
that, so a current powershell should work AFAIU.

I tried to test this on my windows laptop, but I didn't manage to run 
gdb on it in either windows console or powershell, though the cygwin 
shell did work.

Thanks,
- Tom

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


      reply	other threads:[~2025-07-19 16:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-19  6:16 Tom de Vries
2025-07-19  6:47 ` Eli Zaretskii
2025-07-19 16:07   ` Tom de Vries [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31e0fea7-9a20-4c35-9cae-b0f3f8dd20e1@suse.de \
    --to=tdevries@suse.de \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox