简体   繁体   English

在 VSCODE 中将 Python 终端从 Bash 更改为 CMD

[英]Change the Python Terminal from Bash to CMD in VSCODE

I am trying to change the Executing Terminal for python in VSCode from Bash to CMD.我正在尝试将 VSCode 中的 python 执行终端从 Bash 更改为 CMD。 I already tried changing the default terminal by following this , but no luck.我已经尝试按照this更改默认终端,但没有运气。

Detailed Explanation:详细说明:

In Vscode , when i hit the run button for executing python.在 Vscode 中,当我点击运行按钮执行 python 时。 I see that , the execution automatically chooses the Bash terminal , but i would need the execution to happen in CMD.我看到了,执行会自动选择 Bash 终端,但我需要在 CMD 中执行。

You can check it in settings.您可以在设置中检查它。

在此处输入图像描述

It's the same as adding the following line into your setting.json:这与将以下行添加到您的 setting.json 中相同:

    "terminal.integrated.defaultProfile.windows": "Command Prompt",

If it still doesn't work, try reinstalling vscode如果还是不行,重装vscode试试

如果您只是更改了默认终端,请尝试重新启动计算机,这对我有用,在我这样做之前没有考虑到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM