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

Lebec 1 Reputation point
2021-09-12T05:03:53.067+00:00

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 Monitored
Not Monitored
Tag not monitored by Microsoft.
36,250 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. PengGe-MSFT 3,336 Reputation points
    2021-09-13T06:57:12.417+00:00

    Hi @Lebec

    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://learn.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

    0 comments No comments

  2. Sam of Simple Samples 5,516 Reputation points
    2021-09-13T08:08:13.177+00:00

    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.