Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <guinevere@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: Make startup message more user friendly
Date: Mon, 13 Oct 2025 17:30:45 -0300	[thread overview]
Message-ID: <92b1136c-c739-4a1d-9828-642c0faa5051@redhat.com> (raw)
In-Reply-To: <87y0piwmbr.fsf@tromey.com>

On 10/10/25 5:09 PM, Tom Tromey wrote:
>>>>>> "Guinevere" == Guinevere Larsen <guinevere@redhat.com> writes:
> Guinevere> This commit attempts to make the startup message more friendly to new
> Guinevere> users by using ascii art separators.  If there is enough space availabe,
> Guinevere> an ascii art box is printed containing the hints, otherwise a simple
> Guinevere> separator is printed.  The code deems "enough space available" when
> Guinevere> there is enough space to print the documentation URL inside the box,
> Guinevere> since the other hints will be broken into multiple lines if necessary.
> Guinevere> Here are examples of the 2 possible startups, with enough space:
>
> If emojis_ok() then it seems like this could use Unicode line drawing
> instead.
Good idea, I'll look into that
> Guinevere> Unfortunately, I was not able to think of a way in which the code could
> Guinevere> break a line if necessary and also include styled code for URLs and
> Guinevere> commands, so, since I believe it is more important to have the box as
> Guinevere> available as possible, I opted to not include any styling options.
>
> I'm not sure I really understand the problem but I think this would be a
> step backward.
>
> There are facilities to manipulate these sequences.  E.g. see what
> no_terminal_escape_file or escape_buffering_file do.

It's not that I don't know how to recognize the sequences, but rather 
that I didn't know how to handle the %ps for counting spaces.

I guess I would need to apply the style and check the gdb_byte* for the 
spaces? How would I go about that?

>
> One option might be to reimplement this as a ui_file that will only
> split at un-styled spaces; and if the screen isn't big enough just omit
> the box.  Then print_gdb_hints wouldn't need two branches printing the
> same stuff.
I think implementing a ui_file would be overboard. If the style has been 
pre-applied, the function box_one_message can be print_starter_hint, and 
be generic enough to not need the multiple paths.

-- 
Cheers,
Guinevere Larsen
It/she


  reply	other threads:[~2025-10-13 20:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 16:39 Guinevere Larsen
2025-10-10 20:09 ` Tom Tromey
2025-10-13 20:30   ` Guinevere Larsen [this message]
2025-10-15 15:17   ` Guinevere Larsen
2025-10-15 16:54     ` Tom Tromey
2025-10-15 17:07       ` Guinevere Larsen
2025-10-15 20:30         ` Tom Tromey
2025-10-17 14:10         ` Andrew Burgess

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=92b1136c-c739-4a1d-9828-642c0faa5051@redhat.com \
    --to=guinevere@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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