Open cirolaferrara opened 7 years ago
Confirm that the issue is a bug here: https://github.com/nategood/commando/blob/ba476a3928dcecfb257f9daf7d965a3abe53b6bd/src/Commando/Util/Terminal.php#L53
And this should be solved with the following patch:
diff --git a/src/Commando/Util/Terminal.php b/src/Commando/Util/Terminal.php
index ff49888..5b252d8 100644
--- a/src/Commando/Util/Terminal.php
+++ b/src/Commando/Util/Terminal.php
@@ -50,6 +50,17 @@ class Terminal
*/
private static function tput($default, $param = 'cols')
{
+ if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
+ $test = shell_exec('mode con');
+ if (empty($test))
+ return $default;
+ $result = explode(':', $test);
+ $lines = (int)$result[2];
+ $cols = (int)$result[3];
+ if ('lines' === $param) return $lines;
+ if ('cols' === $param) return $cols;
+ }
+
$test = exec('tput ' . $param . ' 2>/dev/null');
if (empty($test))
return $default;
I can confirm that this does indeed fix the issue.
--help command gives me Could not find the specified path.
PHP code:
Output:
composer.json:
I am on Windows