- Get the terminal size from STDOUT or STDERR when the terminal size of
STDIN is not available.
Closes https://github.com/curl/curl/pull/22276
struct winsize ts;
if(!ioctl(STDIN_FILENO, TIOCGWINSZ, &ts))
cols = (int)ts.ws_col;
+ else if(!ioctl(STDOUT_FILENO, TIOCGWINSZ, &ts))
+ cols = (int)ts.ws_col;
+ else if(!ioctl(STDERR_FILENO, TIOCGWINSZ, &ts))
+ cols = (int)ts.ws_col;
#elif defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
{
HANDLE stderr_hnd = GetStdHandle(STD_ERROR_HANDLE);