Skip to content

Commit

Permalink
fix "stty: 'standard input': Inappropriate ioctl for device" spam
Browse files Browse the repository at this point in the history
  • Loading branch information
falkenhawk committed Dec 5, 2022
1 parent e0b1c65 commit 7733ea7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ public function setWidth($width = null)
$this->_width = 80;

// Try to determine the width through stty
if (preg_match('#\d+ (\d+)#', @shell_exec('stty size'), $match) === 1) {
if (preg_match('#\d+ (\d+)#', @shell_exec('stty size 2>/dev/null'), $match) === 1) {
$this->_width = (int) $match[1];
} else if (preg_match('#columns = (\d+);#', @shell_exec('stty'), $match) === 1) {
} else if (preg_match('#columns = (\d+);#', @shell_exec('stty 2>/dev/null'), $match) === 1) {
$this->_width = (int) $match[1];
}
}
Expand Down

0 comments on commit 7733ea7

Please sign in to comment.