Vscode: The terminal process terminated with exit code: {0}

Created on 19 Aug 2019  Â·  20Comments  Â·  Source: microsoft/vscode

Can not open the integrated terminal window. I tried reinstalling the application and deleting the code directories in %appdata% and %localappdata% as well as trying to use different integrated terminals.

if I try to open the terminal a second time, a bit more specific error shows.

The terminal process command 'C:\Program Files\Git\bin\bash.exe' failed to launch (exit code: {2})

Steps to reproduce:

  1. Perform a clean install of vscode.
  2. Try to open the integrated terminal.
*not-reproducible integrated-terminal

Most helpful comment

I found a charm for malwarebytes
You need to add winpty-agent.exe in allow list of malwarebytes
TO DO SO:

  1. Open malwarebytes
  2. Click the settings icon in the upper-right corner just from the help button
    3.Go to the allow list tab
    4.Click add button
    5.choose allow a file or folder
    6.Click select file and go to the path of your Visual Studio Code.. for my case is:
    C:\Users\dilun_000\AppData\Local\Programs\Microsoft VS Code
    7.Continue opening folders pointing in this direction:
    resources\app\node_modules.asar.unpacked\node-pty\build\Release
    8.Click winpty-agent then press Open

This should work. May Jesus Christ be with you

All 20 comments

@daanvannieuwenhuizen do you use a language pack or are you using English?

I'm using English.

@daanvannieuwenhuizen can you share your settings.json file? Also to clarify, you're just in a regular Windows window, not in a remote workspace?

I have the same issue... Additionally test two different options that works until I restart the computer:
a) Update windows 10 version to 1903, works for a day but the error comes again the next day.
b) Add antivirus exception for WinPTY agent, works until restart the computer too.

Closing as I can't repro and OP's account got deleted

@jlagr make sure conpty is turned on in settings

Same problem:
The terminal process terminated with exit code: {0}

  1. Uninstalled VSCode
  2. Installed again
    Problem persists

Same problem:
I already perform the following:
1. Uninstalled then install the VSCode.
2. Update the VSCode.

Error Message

+ 1 on this issue from me.

Same issue pretty much. Searched answers since 2019 , but none of them seems to fix the issue. Funny enough I was getting exit(2) at first and then, I added exception for winpty.dll in Bit Defender so managed to get as far as exit(0). What waste of day, sigh!

UPDATE : In fact. when I try "New Terminal" it goes back to
"The terminal process command 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe' failed to launch (exit code: {2}) "

oh well, GG!

I get the same error too. Using Win 10 , running VS Code as administrator.

same issue here. unistalled vscode, pwsh. Reinstalled both. deleted .vscode folder. Unistalled ...
This is very vexing. i also get the "language service" could not start.

I had the same issue. I disabled malware antivirus from malware bytes and now it works.I also have bit defender antivirus but there is no issue with it when using terminal on visual studio code

The terminal issue is fixed when I disable the ransomware protection in real-time in Malwarebytes. I don't know why

Same!!! WTF moment really
[image: image.png]

On Wed, Mar 4, 2020 at 5:48 AM Hugo Derre notifications@github.com wrote:

The terminal issue is fixed when I disable the ransomware protection in
real-time in Malwarebytes. I don't know why

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode/issues/79427?email_source=notifications&email_token=AJCTECMBIVATU2S46LNFHQLRFVUKHA5CNFSM4IMXUK7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENVCZUA#issuecomment-594160848,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJCTECPH5RBUWCXHZSEL5MDRFVUKHANCNFSM4IMXUK7A
.

--
Best Regards,
Aby

Yup, same fix here. MalwareBytes seems to view this software as doing something malicious. I have to turn off MalwareBytes to use VS Code? Not a good idea.

Yup, same fix here. MalwareBytes seems to view this software as doing something malicious. I have to turn off MalwareBytes to use VS Code? Not a good idea.

Of course dude works!!! but can't we add exception to this software in malwarebyte?

I found a charm for malwarebytes
You need to add winpty-agent.exe in allow list of malwarebytes
TO DO SO:

  1. Open malwarebytes
  2. Click the settings icon in the upper-right corner just from the help button
    3.Go to the allow list tab
    4.Click add button
    5.choose allow a file or folder
    6.Click select file and go to the path of your Visual Studio Code.. for my case is:
    C:\Users\dilun_000\AppData\Local\Programs\Microsoft VS Code
    7.Continue opening folders pointing in this direction:
    resources\app\node_modules.asar.unpacked\node-pty\build\Release
    8.Click winpty-agent then press Open

This should work. May Jesus Christ be with you

I found a charm for malwarebytes
You need to add winpty-agent.exe in allow list of malwarebytes
TO DO SO:

  1. Open malwarebytes
  2. Click the settings icon in the upper-right corner just from the help button
    3.Go to the allow list tab
    4.Click add button
    5.choose allow a file or folder
    6.Click select file and go to the path of your Visual Studio Code.. for my case is:
    C:\Users\dilun_000\AppData\Local\Programs\Microsoft VS Code
    7.Continue opening folders pointing in this direction:
    resources\app\node_modules.asar.unpacked\node-pty\build\Release
    8.Click winpty-agent then press Open

This should work. May Jesus Christ be with you

Jesus is real, Thank you!

You could just close the other instances of cmd or powershell that are open, that always did the trick fro me!

Apparently, this happens when you upgrade VSCode on a windows version lower than 1903
You can check your version under Settings >> About >> Windows Specifications
Upgrading to version 1903 might resolve your issue but if your version is lower like mine (1809), then adding these settings in my settings.json resolved the issue.

-- Use the location of the command prompt tool you are using like cmd, powershell, bash etc.
I use bash and this is where I have it installed.

"terminal.external.windowsExec": "C:/Program Files/Git/bin/bash.exe",
"terminal.integrated.scrollback": 1000,
"terminal.integrated.shell.windows": "C:/Program Files/Git/bin/bash.exe",

Was this page helpful?
0 / 5 - 0 ratings