public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* TUI single key mode: how to customize a key?
@ 2019-08-14 18:01 Aleksey Midenkov
  2019-10-18 13:12 ` Luis Machado
  0 siblings, 1 reply; 4+ messages in thread
From: Aleksey Midenkov @ 2019-08-14 18:01 UTC (permalink / raw)
  To: gdb

Is this customizable? Particularly I don't like 'r' key as it aggressive
enough to restart a program without a confirmation. And you can just miss a
row and press 'r' instead of 'f'. So I'd like to remove 'r' hotkey.

-- 
All the best,

Aleksey Midenkov
@midenok

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TUI single key mode: how to customize a key?
  2019-08-14 18:01 TUI single key mode: how to customize a key? Aleksey Midenkov
@ 2019-10-18 13:12 ` Luis Machado
  2019-10-25 14:19   ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Luis Machado @ 2019-10-18 13:12 UTC (permalink / raw)
  To: Aleksey Midenkov, gdb

Hi,

On 8/14/19 3:01 PM, Aleksey Midenkov wrote:
> Is this customizable? Particularly I don't like 'r' key as it aggressive
> enough to restart a program without a confirmation. And you can just miss a
> row and press 'r' instead of 'f'. So I'd like to remove 'r' hotkey.
> 

No. Unfortunately the keys are hardcoded in gdb/tui/tui.c:

static const struct tui_char_command tui_commands[] = {
   { 'c', "continue" },
   { 'd', "down" },
   { 'f', "finish" },
   { 'n', "next" },
   { 'o', "nexti" },
   { 'r', "run" },
   { 's', "step" },
   { 'i', "stepi" },
   { 'u', "up" },
   { 'v', "info locals" },
   { 'w', "where" },
   { 0, 0 },
};

I don't see a problem with making those configurable. Feel free to send 
a patch for it or a design idea so we can make this work.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TUI single key mode: how to customize a key?
  2019-10-18 13:12 ` Luis Machado
@ 2019-10-25 14:19   ` Tom Tromey
  2019-10-25 14:40     ` Luis Machado
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2019-10-25 14:19 UTC (permalink / raw)
  To: Luis Machado; +Cc: Aleksey Midenkov, gdb

>>>>> "Luis" == Luis Machado <luis.machado@linaro.org> writes:

Luis> No. Unfortunately the keys are hardcoded in gdb/tui/tui.c:

Luis> static const struct tui_char_command tui_commands[] = {
Luis>   { 'c', "continue" },
Luis>   { 'd', "down" },
Luis>   { 'f', "finish" },
Luis>   { 'n', "next" },
Luis>   { 'o', "nexti" },
Luis>   { 'r', "run" },
Luis>   { 's', "step" },
Luis>   { 'i', "stepi" },
Luis>   { 'u', "up" },
Luis>   { 'v', "info locals" },
Luis>   { 'w', "where" },
Luis>   { 0, 0 },
Luis> };

Luis> I don't see a problem with making those configurable. Feel free to
Luis> send a patch for it or a design idea so we can make this work.

Actually, I implemented this a short time ago.
You have to use a gdb that is built against Readline 8.0.
See:

commit 11061048d1fed4465b0e62eb3c14dabf0beab59b
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Sep 10 17:25:35 2019 -0600

    Give a name to the TUI SingleKey keymap
    
    Readline 8.0 has a feature that lets an application name a keymap.
    This in turn makes it simpler for users to bind keys in keymaps in
    their .inputrc.
    
    This patch gives a name to the TUI SingleKey keymap, so that
    additional bindings can be made there.  For example:
    
        $if gdb
        set keymap SingleKey
        "X": "echo hello\\n\n"
        $endif

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TUI single key mode: how to customize a key?
  2019-10-25 14:19   ` Tom Tromey
@ 2019-10-25 14:40     ` Luis Machado
  0 siblings, 0 replies; 4+ messages in thread
From: Luis Machado @ 2019-10-25 14:40 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Aleksey Midenkov, gdb

On 10/25/19 11:19 AM, Tom Tromey wrote:
>>>>>> "Luis" == Luis Machado <luis.machado@linaro.org> writes:
> 
> Luis> No. Unfortunately the keys are hardcoded in gdb/tui/tui.c:
> 
> Luis> static const struct tui_char_command tui_commands[] = {
> Luis>   { 'c', "continue" },
> Luis>   { 'd', "down" },
> Luis>   { 'f', "finish" },
> Luis>   { 'n', "next" },
> Luis>   { 'o', "nexti" },
> Luis>   { 'r', "run" },
> Luis>   { 's', "step" },
> Luis>   { 'i', "stepi" },
> Luis>   { 'u', "up" },
> Luis>   { 'v', "info locals" },
> Luis>   { 'w', "where" },
> Luis>   { 0, 0 },
> Luis> };
> 
> Luis> I don't see a problem with making those configurable. Feel free to
> Luis> send a patch for it or a design idea so we can make this work.
> 
> Actually, I implemented this a short time ago.
> You have to use a gdb that is built against Readline 8.0.
> See:
> 
> commit 11061048d1fed4465b0e62eb3c14dabf0beab59b
> Author: Tom Tromey <tom@tromey.com>
> Date:   Tue Sep 10 17:25:35 2019 -0600
> 
>      Give a name to the TUI SingleKey keymap
>      
>      Readline 8.0 has a feature that lets an application name a keymap.
>      This in turn makes it simpler for users to bind keys in keymaps in
>      their .inputrc.
>      
>      This patch gives a name to the TUI SingleKey keymap, so that
>      additional bindings can be made there.  For example:
>      
>          $if gdb
>          set keymap SingleKey
>          "X": "echo hello\\n\n"
>          $endif
> 
> Tom
> 

Ah, great! I somehow missed that very useful change.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-25 14:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14 18:01 TUI single key mode: how to customize a key? Aleksey Midenkov
2019-10-18 13:12 ` Luis Machado
2019-10-25 14:19   ` Tom Tromey
2019-10-25 14:40     ` Luis Machado

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).