gdbtui

`gdb -tui` disables backspace left/right arrow


I'm trying to debug some embedded c code, I can connect the debugger and debug the target but when switching to the tui mode some keys stop working.

When running gdb in tui mode, either via gdb -tui or inside gdb using ctrl+x a, the keys backspace, left arrow and right arrow don't work. up arrow and down arrow change the view in the code viewer on top.

I can type commands in the cmd and execute them and I can cancel a command using ctrl + c.

This is on AlmaLinux 9.5 & Ubuntu 24.10 using Konsole, Xterm and UXTerm. gdb versions 14.2 and 15.1.

Why is the backspace losing functinality?


Solution

  • In TUI mode the arrow keys will move the source code by default. (At least it does for my version of gdb 15.0.50.20240403-git).

    As mentioned by ks1322, changing the focus with (ctrl+shift+o) should work. But if it still doesn't, you could try the following readline shortcuts which should do the same thing as you wanted.

    In TUI mode, backspace should still work, so I am not sure why it doesn't. The readline shortcuts should work in either mode, i.e., whether the focus is on the source (src) or the command line (cmd).