microsoft/ptvsd

VSCode Debug mode starts without real debugger.

jhyunetp opened this issue · 1 comments

Environment data

  • PTVSD version: ?
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.2
  • Using VS Code or Visual Studio: VSCode

Actual behavior

Python Debug Mode doesn't clear terminal before it commands.

Expected behavior

Remove all written string on terminal and Start Debugging mode

XXX

Steps to reproduce:

  1. type anything in terminal (I typed 341431 below)
  2. Press F5 ( debug )
    C:\Users\Antonio\Documents\인호님 튜터링>341431 cmd /C "set "DEBUGPY_LAUNCHER_PORT=60452" && C:\Users\Antonio\AppData\Local\Programs\Python\Python38\python.exe c:\Users\Antonio\.vscode\extensions\ms-python.python-2020.4.76186\pythonFiles\lib\python\debugpy\no_wheels\debugpy\launcher "c:\Users\Antonio\Documents\인호님 튜터링\a.py" " '341431' is not recognized as an internal or external command, operable program or batch file.
    image
  3. terminal is now cleared
  4. Press Shift + F5 ( debug ) again
    -> Nothing happens - There is already a debug configuration "Python: Current File" running.
  5. I have to Press F5 over and over again until Debugger time out happens.

This can happen if you had something typed at the command prompt in the terminal before you start debugging. It's a fundamental VSCode limitation: when the debugger asks it to run your program, it simulates text input in the shell - but it has no way of knowing whether the shell prompt is in a valid state or not; and if not, it doesn't know what it needs to do to clear it.

You're welcome to file it as a feature request in the vscode repo, but I'm not sure what they can do about it without a cooperative shell.