question

LeeQiao-3513 avatar image
0 Votes"
LeeQiao-3513 asked LeeQiao-3513 commented

Visual Studio Code: debug Python in Windows Terminal (cmd), instead of PowerShell

I have my Python code running fine in Visual Studio Code on Windows 10. The problem is when I try to run "debug in terminal", I always get the PowerShell terminal launched. I need Windows Command terminal (CMD). I have already set my default terminal to Windows Command Shell (CMD) terminal. If I click "terminal", and then "new terminal" in VS Code, I can get Windows Command (CMD) terminal. But when I type "RUN", then "Start Debugging", I got PowerShell terminal launched, which is not able to activate my Conda environment. This worked fine in my older version of VS Code, until I upgraded my Visual Studio Code to the latest version 1.60.0. I also tried to de-install my VS Code completely and reinstall VS Code again, and the issue persist. Now I could not debug and trace my Python program any more in VS Code, very much appreciated if anyone can help, thanks.

not-supported
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PengGe-MSFT avatar image
0 Votes"
PengGe-MSFT answered

Hi @LeeQiao-3513

Welcome to Microsoft Q&A!

Thank you for taking time to post this issue in Microsoft Q&A forum. Visual Studio Code is currently not supported in the Microsoft Q&A forums, the supported products are listed over here: https://docs.microsoft.com/en-us/answers/products/ (more to be added later on).

You can ask questions and search for answers on StackOverflow and enter issues and feature requests directly in our GitHub repository.
Thanks for your understanding.

Sincerely,
Peng


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SimpleSamples avatar image
0 Votes"
SimpleSamples answered LeeQiao-3513 commented

In the VS Code terminal is there a drop-down that looks as in the following?

131490-t.jpg

If so then you can change from PowerShell to Command Prompt. I do not know if that will solve the problem but it is related to something Microsoft has done recently. Windows now has pseudoconsoles that are intended to be an improvement but they can also be extremely confusing. If you read about them you will see that you can install a new program called the Windows Terminal that is a new type of console. It was confusing for me because when I execute it I get PowerShell. Eventually I found The in and outs of Microsoft's new Windows Terminal • The Register that says there is a drop-down menu that lets you select which command line application - such as cmd, PowerShell, a Windows Subsystem for Linux distribution – you would like to use.




t.jpg (22.1 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks SimpleSamples for the comment. I did that drop down terminal selection, and I selected "Command Prompt". That is why when I just do Terminal and New Terminal, I can get CMD.exe terminal popped up. But when I type "RUN", then "Start Debugging", I still get PowerShell terminal launched. This worked fine in my older version of VS Code, until I upgraded my Visual Studio Code to the latest version 1.60.0 recently.

0 Votes 0 ·