Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

runInterminal response not being handled #52

Closed
DonJayamanne opened this issue Feb 9, 2018 · 1 comment
Closed

runInterminal response not being handled #52

DonJayamanne opened this issue Feb 9, 2018 · 1 comment

Comments

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Feb 9, 2018

microsoft/vscode-python#746

@int19h @ericsnowcurrently

When debugging a Python app using the external terminal or terminal integrated into VS Code, PTVSD does not handle the response sent to it. The response is below.
{"type":"response","seq":3,"command":"runInTerminal","request_seq":2,"success":true}

Note, the request was not sent by PTVSD, it was sent by the typescript code (adapter) to launch the PTVSD (debugger in a terminal). This is a protocol request sent to VS Code.

The chain of events is as follows:

  • VS Code sends initialize request to type script debug adapter

  • We respond with list of capabilities

  • Then, we get the launch request from VS Code, type script debug adapter handles this

  • Type script debug adapter sees that the app needs to be launched in a terminal, hence a runInTerminal request is sent to VS Code

  • VS Code launches the app in the terminal

  • PTVSD starts processing requests, by replying back with the initialized event

  • As soon as this event received from PTVSD, typescript debugger will then take VS Code and connect it directly to PTVSD. (i.e. they communicate with each other, streams are piped and typescript debugger is out of the pic).

  • The problem is VS code , sends a couple of requests and responses to PTVSD

  • VS Code sends the response to runInTerminal and a couple of other requests (these are all sent together)

Type Script debugger could intercept these messages and cut and chop the messages before sending them to PTVSD. However that's quite inefficient (reading the streams, parsing it and splitting, then sending the necessary bit. i.e. we're no longer piping the streams).
Hence this bings in a lot more code that necessary.

So, the easiest and best solution is for PTVSD to handle the runInTerminal response and just ignore it, rather than raising an exception.

@DonJayamanne
Copy link
Contributor Author

@int19h @ericsnowcurrently

I'm closing the PR, as I believe I might HAVE to handle this at my end.
Will re-open if necessary.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant