22.2 TUI Key Bindings
The TUI installs several key bindings in the readline keymaps
(see Command Line Editing).
They allow to leave or enter in the TUI mode or they operate
directly on the TUI layout and windows. The TUI also provides
a SingleKey keymap which binds several keys directly to
gdb commands. The following key bindings
are installed for both TUI mode and the gdb standard mode.
- C-x C-a
- C-x a
- C-x A
- Enter or leave the TUI mode. When the TUI mode is left,
the curses window management is left and gdb operates using
its standard mode writing on the terminal directly. When the TUI
mode is entered, the control is given back to the curses windows.
The screen is then refreshed.
- C-x 1
- Use a TUI layout with only one window. The layout will
either be `source' or `assembly'. When the TUI mode
is not active, it will switch to the TUI mode.
Think of this key binding as the Emacs C-x 1 binding.
- C-x 2
- Use a TUI layout with at least two windows. When the current
layout shows already two windows, a next layout with two windows is used.
When a new layout is chosen, one window will always be common to the
previous layout and the new one.
Think of it as the Emacs C-x 2 binding.
- C-x o
- Change the active window. The TUI associates several key bindings
(like scrolling and arrow keys) to the active window. This command
gives the focus to the next TUI window.
Think of it as the Emacs C-x o binding.
- C-x s
- Use the TUI SingleKey keymap that binds single key to gdb commands
(see TUI Single Key Mode).
The following key bindings are handled only by the TUI mode:
- <PgUp>
- Scroll the active window one page up.
- <PgDn>
- Scroll the active window one page down.
- <Up>
- Scroll the active window one line up.
- <Down>
- Scroll the active window one line down.
- <Left>
- Scroll the active window one column left.
- <Right>
- Scroll the active window one column right.
- <C-L>
- Refresh the screen.
In the TUI mode, the arrow keys are used by the active window
for scrolling. This means they are available for readline when the
active window is the command window. When the command window
does not have the focus, it is necessary to use other readline
key bindings such as C-p, C-n, C-b and C-f.