Pseudoterminal
A pseudoterminal (PTY) is a pair of virtual devices that provides a terminal interface to programs, enabling software to interact with another process as if it were a physical terminal. The pair consists of a master and a slave; the master is controlled by a terminal-emulating process, while the slave behaves like a terminal device for the other process.
Data flows between the two ends: input written to the master is delivered to the slave as
On Unix-like systems, the master is created with /dev/ptmx, and a corresponding slave device is exposed under
Common uses include terminal emulators, remote shells accessed via SSH, and terminal multiplexers like tmux or
Background: Pseudoterminals are part of the Unix TTY subsystem and differ from physical serial terminals by