Spawn the subprocess with a pseudo-terminal (PTY) attached.
When this option is provided:
stdin,stdout, andstderrare all connected to the terminal- The subprocess sees itself running in a real terminal (
isTTY = true) - Access the terminal via
subprocess.terminal subprocess.stdin,subprocess.stdout,subprocess.stderrreturnnull
Only available on POSIX systems (Linux, macOS).