Skip to content

Commit

Permalink
Suppress tput stderr. Use COLUMNS env var 1st if available.
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlost committed Jul 26, 2017
1 parent 2d2b582 commit 105bc96
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 105bc96

Please sign in to comment.