Skip to content

Commit 0c03385

Browse files
authored
refactor(console): drop interactive terminal support on Windows (#1628)
1 parent e5bd504 commit 0c03385

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/console/src/Terminal/Terminal.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
use function function_exists;
1616
use function Tempest\Support\arr;
1717

18-
use const DIRECTORY_SEPARATOR;
19-
2018
final class Terminal
2119
{
2220
public int $width;
@@ -151,11 +149,11 @@ public function disableTty(): self
151149

152150
public static function supportsTty(): bool
153151
{
154-
if (! function_exists('shell_exec')) {
152+
if (PHP_OS_FAMILY === 'Windows' || ! function_exists('shell_exec')) {
155153
return false;
156154
}
157155

158-
return (bool) shell_exec('stty 2> ' . ('\\' === DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null'));
156+
return (bool) shell_exec('stty 2> /dev/null');
159157
}
160158

161159
private function clear(): self

0 commit comments

Comments
 (0)