-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Closed
Labels
*as-designedDescribed behavior is as designedDescribed behavior is as designeddebugDebug viewlet, configurations, breakpoints, adapter issuesDebug viewlet, configurations, breakpoints, adapter issues
Description
- VSCode Version:Version 1.31.0-insider (1.31.0-insider)
- OS Version:Mac
Steps to Reproduce:
- Install latest version of Python Extension
- Install python
- Brew install
pipenv - Open a folder in VSC
- Add a python file with a simple
print("Hello")statement - Open the terminal in VSC and type the command
pipenv shell- This will create a virtual environment for the current folder
- Open another terminal and notice how the Python extension will automatically add
pipenv shell, causing the previously created environment to get activated in this new terminal. - Reload VSC
- The above
pipenvenvironment will now be automatically selected - If not, please use the command
Select Python Interpreter - From the list, of interpreters select the interpreter with the name same as the folder name you are in.
- The above
- Debug the python file
- The terminal will now open automatically
- Python Extension will send the text
pipenv shellto activate the environment in the terminal - VSC Debugger sends the necessary commands to the terminal
- Unfortunately there's a race condition here,
pipenv shellhas not yet completed, and the commands sent by VSC debugger get swallowed up
- End result, debugger doesn't start
Causes:
- There's no way to determine when terminal has completed processing previously sent commands.
- VSC is sending messages to the terminal, when its busy
Solutions:
- Python extension can take complete control of opening terminals, etc and not use
runInTerminalrequest (i.e. python extension re-invent the wheel). - VSC DAP accepts additional commands that need to be invokved in the
runInTerminalrequest.
Currently we can only sendargs, how about extending this to sendcommandsas well.
This way the extension can send some custom commands that need to be executed before the VSC debugger commands. I.e. chain them together.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
*as-designedDescribed behavior is as designedDescribed behavior is as designeddebugDebug viewlet, configurations, breakpoints, adapter issuesDebug viewlet, configurations, breakpoints, adapter issues