cyrus-and / gdb-dashboard

Modular visual interface for GDB in Python
MIT License
10.99k stars 768 forks source link

Single key mode #280

Closed MaxGyver83 closed 1 year ago

MaxGyver83 commented 1 year ago

I like gdb-dashboard but I also like gdb's TUI Single Key Mode (it allows you to just press c, s, n, r without having to confirm with Enter).

Can I somehow use both together?

When I use gdb-dashboard and then activate the TUI Single Key Mode (by pressing Ctrl-x, s), I get an additional source code window. It looks like it can't be hidden. The best I could achieve was first checking its height with first q (leaving single key mode) and then:

>>> info win
Name       Lines Columns Focus
src           39     232 (has focus)
status         1     232
cmd           20     232

Then I can reduced the source code window height to 4 (less is not allowed):

>>> winheight src -35

When I then activate the single key mode again (Ctrl-x, s) and press n multiple times, I end up with a broken output after a while. Example:

image

cyrus-and commented 1 year ago

The dashboard is not meant to be working with the TUI mode. You can achieve something similar by customising your Readline configuration file (~/.inputrc), for example:

$if gdb
    C-n: "\C-a\C-kserver step\n"
    C-c: "\C-a\C-kserver continue\n"
    # ...
$endif

(Where: \C-a\C-k discards the current input, server bypasses the GDB history, \n executes the line.)

MaxGyver83 commented 1 year ago

Thank you! This is an improvement! But Ctrl-c always quits, even with C-c: "\C-a\C-kserver continue\n".

cyrus-and commented 1 year ago

That was just an example, you can choose any other modifier, for example Alt or even combinations with Shift.

MaxGyver83 commented 1 year ago

It looks like Ctrl-c and many other combinations can't be remapped, see this. No problem, I'll find some free combinations. Thank you!