Visual Studio (VS-code) 代码终端无法启动 [英] Visual Studio (VS-code) code terminal is failing to launch

查看:346
本文介绍了Visual Studio (VS-code) 代码终端无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译一个程序,但终端没有打开.

错误:终端进程无法启动:起始目录(cwd)D:\vs code\march long 2020"不存在.

这个人有同样的错误,但弹出窗口不同

之后我无法再次打开终端.

要再次将 CMD 设为默认值,我必须更改 VS Code 设置中的路径:

  • 打开首选项 >设置 (CTRL+,)
  • 搜索terminal.integrated.shell.windows

  • 点击在settings.json中编辑
  • 设置CMD路径terminal.integrated.shell.windows":C:\\windows\\System32\\cmd.exe",

现在终端应该再次打开.这不是让 Powershell 在 VS Code 中工作的修复,只是恢复终端窗口的指南.

I tried to compile a program but terminal is not opening.

error:The terminal process failed to launch: Starting directory (cwd) "D:\vs code\march long 2020" does not exist.

this guy has same error but pop-up is different link

below is the JSON file of my vscode

{
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "C_Cpp.updateChannel": "Insiders",
    "files.autoSave": "afterDelay",
    "java.saveActions.organizeImports": true,
    "window.zoomLevel": 0,
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "terminal.integrated.windowsEnableConpty": false,
    "json.schemas": [
    
    ]
}

see this link for full error description, i wrote code and compiled and got error message. link

解决方案

Had the same issue as I changed the default shell in VS Code to Powershell. In my case powershell is blocked due company admin.

This setting breaks my terminal window:

Afterwards I could not open the terminal again.

To get CMD as default again I had to change the path in the VS Code settings:

  • open Preferences > Settings (CTRL+,)
  • search for terminal.integrated.shell.windows

  • click Edit in settings.json
  • set CMD path "terminal.integrated.shell.windows": "C:\\windows\\System32\\cmd.exe",

Now the terminal should open again. This is not a fix to get Powershell working in VS Code, just a guide to restore the terminal window.

这篇关于Visual Studio (VS-code) 代码终端无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆