Chan Kim
Chan Kim

Reputation: 5989

how to use arrow keys to edit command in gdb command window?

While using gdb in 'layout src' window mode (command at the bottom and source at the top), often I want to go back some characters to modify the current command I'm editing in the gdb command window. But pressing left or right key just moves the source window. How can I do it?

Upvotes: 6

Views: 2782

Answers (1)

Andrew
Andrew

Reputation: 4791

You need to change the input focus, see here for details:

https://sourceware.org/gdb/current/onlinedocs/gdb/TUI-Commands.html#index-focus

Specifically, you want focus cmd. After this you should be able to use the arrow keys to scroll through the GDB history.

Upvotes: 12

Related Questions