If your machine hits its limit for ptys, you'll be unable to open another pseudo terminal.

When attempting to open a new terminal, you may run into errors like the one below

[forkpty: Device not configured]
[Could not create a new process and open a pseudo-tty.]

You can check what the current limit is by using the following command

$ sysctl -a | grep kern.tty.ptmx_max
kern.tty.ptmx_max: 127  

To temporarily increase this limit to 255, run the following command

$ sudo sysctl -w kern.tty.ptmx_max=255

This will bump up the limit until the next restart of the machine.

To change this value permanently, create or open the /etc/sysctl.conf file and add the following line

kern.tty.ptmx_max=255  

If you had to create the file, you'll probably want to alter the permissions on it by using the commands below.

$ sudo chown root:wheel /etc/sysctl.conf
$ sudo chmod 644 /etc/sysctl.conf