Git bash Error: Could not fork child process: There are no available terminals (-1)

A. Petrizza picture A. Petrizza · Aug 21, 2017 · Viewed 83.8k times · Source

I have had up to 8 git bash terminals running at the same time before.

Currently I have only 2 up.

I have not seen this error before and I am not understanding what is causing it.

Any help would be appreciated!

Picture attached:

enter image description here

Answer

Scott Newson picture Scott Newson · Aug 21, 2017

Found a similar issue and solution in google groups

I opened a windows command prompt and ran the command

$ tasklist

It looks as though the ssh connections I had made in my git bash shells weren't being closed when those windows were closed and were hanging the available git bash shell windows.

This may be a dangerous solution but from the windows command prompt I ran

$ taskkill /F /IM ssh.exe 

Everything appears to be working again after this. It may not have directly been an issue of orphan processes, but this worked for at least for me.

Additional note: you can also kill other processes, for example like:

$ taskkill /F /IM vim.exe