Skip to content

Commit

Permalink
Merge pull request #113 from wp-cli/issue_112
Browse files Browse the repository at this point in the history
Suppress tput stderr. Use COLUMNS env var 1st if available.
  • Loading branch information
danielbachhuber authored Jul 26, 2017
2 parents 2d2b582 + 105bc96 commit c5f9c03
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/cli/Shell.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ static public function columns() {
}
}
} else {
if ( getenv( 'TERM' ) ) {
$columns = (int) exec( '/usr/bin/env tput cols' );
if ( ! ( $columns = (int) getenv( 'COLUMNS' ) ) ) {
if ( getenv( 'TERM' ) ) {
$columns = (int) exec( '/usr/bin/env tput cols 2>/dev/null' );
}
}
}
}
Expand Down

0 comments on commit c5f9c03

Please sign in to comment.