Raise your hand if you have run gdb in tui (graphical) mode, only to find you can't refer to the previous command when pressing "up". I can't see you but I know this is true for pretty much everyone reading this blog. All three of you.
In the gdb-TUI mode, the arrow keys are used by the active window for scrolling. This means they are not available for readline, the component that takes care of the magic invocations needed to bring back the previous command from the land of the dead. Luckily there are alternative readline keybindings: just try C-p, C-n, C-b and C-f. Takes a while getting used to it but you can finally use gdb-TUI and forget about copy-pasting every gdb command.
Bonus tip: if pressing "up" (or C-p) in gdb doesn't bring back the previous command, it probably means you don't have the readline package installed. Go ahead an install it. It'll change your life.
thank you dude
ReplyDeleteThanks!
ReplyDeleteThanks. A second option is to focus the command window, then arrows work. To cycle focus: C-x o.
ReplyDelete4 now. Thank you.
ReplyDeleteThank you!
ReplyDeleteThere are dozens of us! dozens!
ReplyDeleteSeems so... and I'm still surprised by that!
ReplyDeleteThanks Anon
More than dozens!!
ReplyDeleteThere is a whole company of us here!
ReplyDeletethere is me too
ReplyDeleteThank you very much, I am learning GDB and this saves me so many grey hairs.
ReplyDelete