Skip to content

Commit 5591e23

Browse files
committed
Put stty inside TERM check. Add some php info to travis.
1 parent f8bb561 commit 5591e23

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ php:
66
- 5.5
77
- 5.6
88

9+
before_script:
10+
- php -m
11+
- php --info | grep -i 'intl\|pcre'
12+
913
script: phpunit
1014

1115
notifications:

lib/cli/Shell.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ static public function columns() {
5050
}
5151
} else {
5252
if ( ! ( $columns = (int) getenv( 'COLUMNS' ) ) ) {
53-
$size = exec( '/usr/bin/env stty size 2>/dev/null' );
54-
if ( '' !== $size && preg_match( '/[0-9]+ ([0-9]+)/', $size, $matches ) ) {
55-
$columns = (int) $matches[1];
56-
}
57-
if ( ! $columns ) {
58-
if ( getenv( 'TERM' ) ) {
53+
if ( getenv( 'TERM' ) ) {
54+
$size = exec( '/usr/bin/env stty size 2>/dev/null' );
55+
if ( '' !== $size && preg_match( '/[0-9]+ ([0-9]+)/', $size, $matches ) ) {
56+
$columns = (int) $matches[1];
57+
}
58+
if ( ! $columns ) {
5959
$columns = (int) exec( '/usr/bin/env tput cols 2>/dev/null' );
6060
}
6161
}

0 commit comments

Comments
 (0)