Introduction

On macOS (Ventura 13.5), while using VS Code with multiple SSH remote sessions, I encountered the following error message when trying to open a new terminal session:

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

Error Description

This error typically occurs when your system has exhausted the available pseudo-terminal (PTY) resources. macOS has a limit on the number of pseudo-terminals that can be used simultaneously. Once this limit is reached, new terminals cannot be opened.

Solution

To increase the maximum number of pseudo-terminals, run the following command:

$ sudo sysctl -w kern.tty.ptmx_max=768 # default was 255

References

  1. Need more pseudo terminals

Leave a comment