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

后端 未结 28 2100
抹茶落季
抹茶落季 2020-12-12 12:17

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 understand

相关标签:
28条回答
  • 2020-12-12 12:27

    finally figured out what was causing this.

    if we use code like this (explicitly or implicitly) i.e. in .bashrc file

    eval $(ssh-agent -s)
    ssh-add ~/.ssh/id_rsa
    

    it spawns a new process.

    if you don't exit it and just close the window, that process is still running. so each new bash opened just keeps adding new ones w/out disposing old ones.

    when done with a bash window, simply hit ctrl+d or type exit to kill the agent process, and you should not run out of forks.

    0 讨论(0)
  • 2020-12-12 12:27

    Just Restart Your Machine, While Restarting our machine this issue is solved try it.

    0 讨论(0)
  • 2020-12-12 12:29

    Windows 10 this worked for me:

    1) open cmd as administrator

    2) type:

    taskkill /f /im git-bash.exe
    


    3) If there was an Error: The process "ssh-agent.exe" not found. then:

    type:

    tasklist
    

    4) Find and kill every process with words like "bash" or "git" (This may be a dangerous solution, but once you will find the process name, next time you will know.)

    taskkill /f /im ***.exe
    
    0 讨论(0)
  • 2020-12-12 12:32

    In my case, it was related with the use of VS code. Previously I have opened VS code using a git bash terminal and executing

    code .
    

    then closing the terminal.

    The problem is solved by closing all the VS code windows opened.

    When you have any editor or IDE configure to open a terminal as git bash, then when the IDE/IDE is running, the git bash will spin up bash from "C:\Windows\System32\bash.exe" and any other attempt to open bash from a separate window is likely to crash.

    The best solution is to kill the IDE/Editor bash and open from a new window or continue from the IDE/Editor command.

    0 讨论(0)
  • 2020-12-12 12:32

    For windows, in task-manager kill sh.exe.

    0 讨论(0)
  • 2020-12-12 12:34

    I see the problem on windows in git bash when I kill my git bash console without using exit. I found killing ssh-agent.exe task from windows task manager to fix the problem.

    0 讨论(0)
提交回复
热议问题