Search code examples
gdbref

How to turn off GDB's ref command?


When using GDB, "ref" command displays source code which is quite useful. But I can't use short key like up arrow when being in this mode. Is there a way to turn off this function?


Solution

  • The refresh command enters TUI mode.

    If you do info win, you'll see something like:

    (gdb) info win
        SRC     (53 lines)  <has focus>
        CMD     (26 lines)
    

    The cursor keys scroll the window that has focus, which is why they reposition source but don't allow you to recall previous commands at the (gdb) prompt. So switch focus back to the prompt with focus cmd, and voila: you can use arrow keys as if you were outside the TUI mode.

    You can also leave the TUI mode completely with C-x C-a, C-x a or C-x A keystroke. Documentation for TUI.