{"record":{"id":"b6993a47d35852a4","repo":"symfony/process","slug":"tty-mode-is-not-supported-on-windows-platform","errorCode":null,"errorMessage":"TTY mode is not supported on Windows platform.","messagePattern":"TTY mode is not supported on Windows platform\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"Process.php","lineNumber":1083,"sourceCode":"            throw new LogicException('Idle timeout cannot be set while the output is disabled.');\n        }\n\n        $this->idleTimeout = $this->validateTimeout($timeout);\n\n        return $this;\n    }\n\n    /**\n     * Enables or disables the TTY mode.\n     *\n     * @return $this\n     *\n     * @throws RuntimeException In case the TTY mode is not supported\n     */\n    public function setTty(bool $tty): static\n    {\n        if ('\\\\' === \\DIRECTORY_SEPARATOR && $tty) {\n            throw new RuntimeException('TTY mode is not supported on Windows platform.');\n        }\n\n        if ($tty && !self::isTtySupported()) {\n            throw new RuntimeException('TTY mode requires /dev/tty to be read/writable.');\n        }\n\n        $this->tty = $tty;\n\n        return $this;\n    }\n\n    /**\n     * Checks if the TTY mode is enabled.\n     */\n    public function isTty(): bool\n    {\n        return $this->tty;\n    }","sourceCodeStart":1065,"sourceCodeEnd":1101,"githubUrl":"https://github.com/symfony/process/blob/99b85026db14a68f02c6f3eeb01a1170ca25c491/Process.php#L1065-L1101","documentation":"setTty(true) throws this RuntimeException on Windows (DIRECTORY_SEPARATOR === '\\\\'), where TTY mode for child processes is not supported by the library. Requesting a TTY means attaching the child's input/output to the terminal, a POSIX-oriented feature.","triggerScenarios":"Calling setTty(true) in code executed on a Windows platform.","commonSituations":"Cross-platform scripts (CLI tools, deployment scripts, tests) that enable TTY for interactive feel and run on Windows; CI environments on Windows runners.","solutions":["Guard setTty(true) with a platform check (PHP_OS_FAMILY !== 'Windows') and skip it on Windows.","Remove TTY mode if interactivity is not required.","On Windows, pass input via setInput()/stdin instead of a TTY."],"exampleFix":"// before\n$process->setTty(true);\n\n// after\nif (PHP_OS_FAMILY !== 'Windows') {\n    $process->setTty(true);\n}","handlingStrategy":"validation","validationCode":"if (PHP_OS_FAMILY !== 'Windows' && $wantTty) {\n    $process->setTty(true);\n}","typeGuard":null,"tryCatchPattern":"try {\n    $process->setTty(true);\n} catch (\\RuntimeException $e) {\n    // Windows: run without TTY\n}","preventionTips":["Gate TTY-dependent behavior on PHP_OS_FAMILY checks.","Test CLI tooling on Windows runners to catch platform-specific paths."],"tags":["process","symfony","tty","windows","platform-limitation"],"backgroundTag":"unsupported-platform","analyzedSha":"99b85026db14a68f02c6f3eeb01a1170ca25c491","analyzedAt":"2026-09-14T11:23:33.683Z","contentChangedAt":"2026-09-14T11:23:33.683Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}