Fix TIOCGWINSZ for FreeBSD (#361)
This commit is contained in:
parent
8a9edc7ecd
commit
17442caee2
@ -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())
|
||||||
|
Loading…
Reference in New Issue
Block a user