public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>,
	Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/2] [gdb/tui] Delete line buffer when switching to singlekey
Date: Fri, 9 Jun 2023 16:37:48 +0200	[thread overview]
Message-ID: <c8c59cc9-996f-d1ca-f8ec-78c93840f948@suse.de> (raw)
In-Reply-To: <87sfb090wc.fsf@tromey.com>

On 6/9/23 16:16, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Tom> The SingleKey "d" is supposed run the "down" command.
> 
> Tom> Fix this by clearing the readline line buffer when switching to SingleKey
> Tom> mode.
> 
> I was wondering if saving and restoring the partial text would be
> better, but honestly this is better than the status quo, and it's not
> clear to me that people switch in and out of SingleKey so much that this
> kind of detail would matter.
> 

Thanks for the review.

We can compare behaviour with C-x a:
- type foo on gdb prompt
- now enter TUI by typing C-x a
- exit TUI again by typing the same
- we see "(gdb) foo" but that's just an artifact, see PR30523
- we type space three times and backspace to overwrite the artifact
- we can now type C-x y, and we get again "(gdb) foo", this time
   indeed in the readline buffer

So, entering TUI with C-x a kills the prompt line and puts it in the 
kill ring.  Exiting TUI does not restore it.

I'm not 100% convinced that the choice of kill rather than delete is 
intentional either.  The comment says:
...
   /* Clear the readline in case switching occurred in middle of 

      something.  */
   if (rl_end)
     rl_kill_text (0, rl_end);
...

So, I opted for a simple delete.

Thanks,
- Tom

> So, seems good.
> 
> Reviewed-By: Tom Tromey <tom@tromey.com>
> 
> Tom


  reply	other threads:[~2023-06-09 14:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 15:03 [PATCH 1/2] [gdb/testsuite] Add test-case gdb.tui/single-key.exp Tom de Vries
2023-06-06 15:03 ` [PATCH 2/2] [gdb/tui] Delete line buffer when switching to singlekey Tom de Vries
2023-06-09 14:16   ` Tom Tromey
2023-06-09 14:37     ` Tom de Vries [this message]
2023-06-09 13:52 ` [PATCH 1/2] [gdb/testsuite] Add test-case gdb.tui/single-key.exp Tom Tromey

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=c8c59cc9-996f-d1ca-f8ec-78c93840f948@suse.de \
    --to=tdevries@suse.de \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).