Broken terminal - [forkpty: Resource temporarily unavailable][Could not create a new process and open a pseudo-tty.]
Asked Answered
S

7

23

I can't start up my terminal on MacOS 10.12

I get the following message:

[forkpty: Resource temporarily unavailable][Could not create a new process and open a pseudo-tty.]

How do I resolve this?

Skippet answered 17/7, 2017 at 17:0 Comment(0)
S
18

I simply restarted my computer to resolve the issue. Hope this helps anyone else in the future.

Skippet answered 17/7, 2017 at 17:7 Comment(2)
Same here but it happens on daily basis.Fled
See my solution above. Restarting your computer every single time is hardly a fix.Zhdanov
P
11

This explination gives slightly more insight into what id goin on. It seems you have too many processes running on your computer and there are certain limits in place.

http://blog.ghostinthemachines.com/2010/01/19/mac-os-x-fork-resource-temporarily-unavailable/

Pleuro answered 31/8, 2017 at 12:18 Comment(1)
This happened when I had Android Studio open. When I closed it, everything was back to normal.Shrewd
I
5

sudo sysctl kern.tty.ptmx_max=255 (or 511, or whatever) should fix it.

My default (in El Capitan) was 127. (As a tmux user, I need more than that.)

To learn more:

sysctl | grep max
ulimit -a
launchctl limit

cat /private/etc/launchd.conf
cat /private/etc/sysctl.conf

man 8 sysctl
Intone answered 15/3, 2018 at 14:21 Comment(4)
This might be a silly question but if terminal won't start up, how are you supposed to enter these commands?Undershirt
Restart your computer, ha ha. Or restart in safe mode if it's coming up right away :)Anticyclone
You can open up activity monitor -> Memory -> kill process thats eating up memory -> Then type commandEnnius
511 didn't work for me, but I set it to 999 and was able to open a new terminal window.Subtraction
P
3

Maybe you opened too many apps, so computer's Memory not enough. I just opened too many apps, and my iterm2 & terminal broke down, till quitted some useless app, reopen the two, everything going to be OK. My Mac is MBA2017 8G.

Pareu answered 14/12, 2018 at 2:27 Comment(0)
Z
2

I had this issue for almost a week and it was driving me nuts because I would have to restart my computer every. single. time.

Sorry but restarting your computer every single time is hardly a solution.

In my case, it was a cron process. I had the process running every minute which seemed to be using up a lot of memory. Steps to solve the problem in my case were:

  1. Run crontab -e and reduced the frequency of the cron process running.
  2. Run Activity Monitor.
  3. If the Activity Monitor icon jumps up and down and doesn't open up, close down some programs. In my case, I shut down Evernote and Slack. That freed up some memory, I think and Activity Monitor opened up.
  4. Click on the Process Name tab in Activity Monitor to arrange processes in alphabetical order.
  5. Scroll down, and you may see a process that keeps repeating. (Here, I saw a lot of cron)
  6. You want to stop all those processes. Select all the renegade processes and in the top left corner, click the x to quit them all. .
  7. That solved my problem.

I will watch over the next few days. If anything changes, I will update. Otherwise, that means it worked.

Goodluck!

Zhdanov answered 23/3, 2020 at 10:4 Comment(0)
G
2

In my case the culprit was visual studio code closing it works chrome too takes too much memory sometime

During that time chrome tab doesn't open, apps fails to start etc

Gliadin answered 27/4, 2023 at 7:0 Comment(0)
M
1
sudo sysctl -w kern.tty.ptmx_max=768

default is 511

Marshamarshal answered 18/8, 2023 at 7:51 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.