cdt-gdb-adapter icon indicating copy to clipboard operation
cdt-gdb-adapter copied to clipboard

Implement inferior in its own terminal on Linux

Open jonahgraham opened this issue 2 years ago • 0 comments

Using DAP's runInTerminal this PR adds the ability to use that new terminal for the inferior's I/O.

This can be enabled by adding "inferiorTerminal": "integrated" or "inferiorTerminal": "external" or "inferiorTerminal": "auto" to the launch.json.

The basic idea of the inferior terminal on Linux is:

  • adapter requests client (aka vscode) to create a terminal (using runInTerminal)
  • in that terminal we run a small script that "returns" the tty name to the adapter (using an atomically created file with the output of tty command)
  • then the script waits until the adapter is complete by monitoring the PID of the adapter's node process

The script run in the terminal won't auto-stop when running the adapter in server mode (typically should only be used for development of the adapter)

Part of #161

TODO for this issue:

  • [ ] write a test
  • [ ] document the change here, or at least in cdt-gdb-vscode's package.json

jonahgraham avatar Feb 07 '23 03:02 jonahgraham