Little fix when $output has not defined such as a normal terminal env like jenkins job execution.
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
/* Get the size of the terminal (only works on Linux, on Windows it's always 80) */
|
/* Get the size of the terminal (only works on Linux, on Windows it's always 80) */
|
||||||
preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", strtolower(exec('stty -a |grep columns')), $output);
|
preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", strtolower(exec('stty -a |grep columns')), $output);
|
||||||
if(sizeof($output) == 3) {
|
if(sizeof($output) == 3 && isset($output[2]) && isset($output[2][0])) {
|
||||||
define("COLUMNS", $output[2][0]);
|
define("COLUMNS", $output[2][0]);
|
||||||
} else {
|
} else {
|
||||||
define("COLUMNS", 80);
|
define("COLUMNS", 80);
|
||||||
|
|||||||
Reference in New Issue
Block a user