zf1s / zf1

Monorepo of a fork of Zend Framework 1, with all components split into individual composer packages. PHP 5.3-8.3 compatible.
BSD 3-Clause "New" or "Revised" License
59 stars 22 forks source link

[zend-progressbar] fix "stty: 'standard input': Inappropriate ioctl for device" spam #155

Closed falkenhawk closed 1 year ago

falkenhawk commented 1 year ago

using zend-progressbar with Console adapter spams stty: 'standard input': Inappropriate ioctl for device on non-interactive shell (e.g. tests on CI)

Never fixed in original zf v2 / laminas: https://github.com/zendframework/zend-progressbar/issues/23 https://github.com/laminas/laminas-progressbar/issues/2

image

falkenhawk commented 1 year ago

@marcinlee suggested that [[ $- == *i* ]] && stty size could be used instead - to avoid calling stty at all when shell is not interactive. Might be cleaner than to discarding stderr. 🤔

partikus commented 1 year ago

@falkenhawk both are fine, IMHO discarding stderr is easier to understand though the condition looks like a more appropriate approach