Fix TIOCGWINSZ for FreeBSD (#361)

This commit is contained in:
Stefan G 2020-01-11 08:31:12 -08:00 committed by Timon
parent 8a9edc7ecd
commit 17442caee2

View File

@ -33,7 +33,9 @@ pub(crate) fn size() -> Result<(u16, u16)> {
ws_ypixel: 0, ws_ypixel: 0,
}; };
if let Ok(true) = wrap_with_result(unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut size) }) { if let Ok(true) =
wrap_with_result(unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ.into(), &mut size) })
{
Ok((size.ws_col, size.ws_row)) Ok((size.ws_col, size.ws_row))
} else { } else {
tput_size().ok_or_else(|| std::io::Error::last_os_error().into()) tput_size().ok_or_else(|| std::io::Error::last_os_error().into())