Skip to content


patch 8.1.0071: terminal debugger only works with the terminal feature
Browse files Browse the repository at this point in the history
Problem:    Terminal debugger only works with the terminal feature.
Solution:   Make it also work with a prompt buffer.  Makes it possible to use
            on MS-Windows. Various other improvements. (closes #3012)
  • Loading branch information
brammool committed Jun 17, 2018
1 parent 222cd20 commit b3307b5
Show file tree
Hide file tree
Showing 3 changed files with 353 additions and 42 deletions.
30 changes: 30 additions & 0 deletions runtime/doc/terminal.txt
Expand Up @@ -38,6 +38,7 @@ If the result is "1" you have it.
Stepping through code |termdebug-stepping|
Inspecting variables |termdebug-variables|
Other commands |termdebug-commands|
Prompt mode |termdebug-prompt|
Communication |termdebug-communication|
Customizing |termdebug-customizing|

Expand Down Expand Up @@ -620,6 +621,10 @@ The Terminal debugging plugin can be used to debug a program with gdb and view
the source code in a Vim window. Since this is completely contained inside
Vim this also works remotely over an ssh connection.

When the |+terminal| feature is missing, the plugin will use the "prompt"
buffer type, if possible. The running program will then use a newly opened
terminal window. See |termdebug-prompt| below for details.

Starting ~
Expand Down Expand Up @@ -799,6 +804,23 @@ Other commands ~
isn't one

Prompt mode ~
When the |+terminal| feature is not supported and on MS-Windows, gdb will run
in a buffer with 'buftype' set to "prompt". This works slightly differently:
- The gdb window will be in Insert mode while typing commands. Go to Normal
mode with <Esc>, then you can move around in the buffer, copy/paste, etc.
Go back to editing the gdb command with any command that starts Insert mode,
such as `a` or `i`.
- The program being debugged will run in a separate window. On MS-Windows
this is a new console window. On Unix, if the |+terminal| feature is
available a Terminal window will be opened to run the debugged program in.

Prompt mode can be used even when the |+terminal| feature is present with: >
let g:termdebug_use_prompt = 1
Communication ~
There is another, hidden, buffer, which is used for Vim to communicate with
Expand Down Expand Up @@ -836,6 +858,14 @@ When 'background' is "dark":
hi debugBreakpoint term=reverse ctermbg=red guibg=red

Shorcuts *termdebug_shortcuts*

You can define your own shortcuts (mappings) to control gdb, that can work in
any window, using the TermDebugSendCommand() function. Example: >
map ,w :call TermDebugSendCommand('where')<CR>
The argument is the gdb command.

Popup menu *termdebug_popup*

By default the Termdebug plugin sets 'mousemodel' to "popup_setpos" and adds
Expand Down

0 comments on commit b3307b5

Please sign in to comment.