Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Terminal/TerminalFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace PhpSchool\CliMenu\Terminal;

use PhpSchool\Terminal\IO\PowerShellInputStream;
use PhpSchool\Terminal\IO\ResourceInputStream;
use PhpSchool\Terminal\IO\ResourceOutputStream;
use PhpSchool\Terminal\Terminal;
Expand All @@ -16,6 +17,12 @@ class TerminalFactory
{
public static function fromSystem(): Terminal
{
return new UnixTerminal(new ResourceInputStream(), new ResourceOutputStream());
if (PHP_OS_FAMILY === 'Windows') {
$input = new PowerShellInputStream();
} else {
$input = new ResourceInputStream();
}
$output = new ResourceOutputStream();
return new UnixTerminal($input, $output);
}
}