Visual Studio Code,如何从powershell.exe切换到cmd.exe

问题描述 投票:27回答:4

我想从powershell.exe切换到终端中的cmd.exe,但我不知道该怎么做。提供了截图以供澄清。

screenshot 1 screenshot 2

visual-studio-code
4个回答
88
投票
  1. Ctrl + Shift + P显示所有命令。
  2. 在显示的文本框中键入shell以筛选列表。
  3. 选择Terminal: Select Default Shell
  4. 系统会提示您输入Select your preferred terminal shell, you can change this later in your settings or follow the same process as we do now
  5. 选择Command Prompt(cmd.exe)
  6. 单击shell窗格中的“删除”图标以删除现有终端。
  7. Ctrl + `(或菜单中的View> Terminal)打开一个新的终端窗格。

6
投票

将此用户设置添加到文件 - 首选项 - 用户设置

// Place your settings in this file to overwrite the default settings
{
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",

}

2
投票

当我点击终端时,我也遇到了这个问题。它显示Powershell但不显示命令提示符,因此我执行了以下步骤以在Visual Studio中获取命令提示符:

  1. 查看 - >命令面板 - >切换集成终端
  2. 通过快捷键ctrl +`或View - >终端打开终端
  3. 将命令写为cmd.exe并运行

1
投票

打开设置(ctrl +逗号)

找到terminal.integrated.shell.windows

C:\\Windows\\System32\\cmd.exe替换它的价值

© www.soinside.com 2019 - 2024. All rights reserved.