简体   繁体   中英

The terminal process command failed to launch exit code:0 and exit code:2

The visual studio code terminal is not working.
The shortcut ctrl+" for the terminal is not working.

Error:

The terminal process terminated with exit code: {0}

The terminal process command

'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe' failed to launch (exit code: {2})

在此处输入图片说明

Try creating an exception rule for winpty-agent.exe in you antivirus program.

File location: 

C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar.unpacked\node-pty\build\Release\winpty-agent.exe

If first solution doesnt work for you, you can try to create exception rule for the whole folder where winpty-agent.exe is stored => "realese"

Folder location: 

C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar.unpacked\node-pty\build\Release

Update 21.3.2020 I also had to make an exception in malwarebytes for winpty-agent.exe in appdata/local

C:\Users\myusername\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar.unpacked\node-pty\build\Release\winpty-agent.exe

Vscode terminal currently does not work with the program Malwarebytes. You will have to uninstall until a fix is made. Antivirus related software seems to be the main culprit.

Had the same problem. For me it helped to start VS code as admin... I'm on a semi-enterprise IT-controlled environment.

I excluded "Microsoft VS Code" folder from ransomware detection, and now I can open a terminal window.

Thanks, Peter

按照以下步骤使用“cmd.exe”而不是“powershell.exe”: https : //stackoverflow.com/a/59416769/2015398

I've recently ran into the same issue while setting up a new web development environment (not just bash but any terminal). For me, I just had to set VS Code to run as administrator and then bam, no problem accessing the command line executable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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