From 17442caee29c57bff11d0cf81015a170df0eab07 Mon Sep 17 00:00:00 2001 From: Stefan G Date: Sat, 11 Jan 2020 08:31:12 -0800 Subject: [PATCH] Fix TIOCGWINSZ for FreeBSD (#361) --- src/terminal/sys/unix.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/terminal/sys/unix.rs b/src/terminal/sys/unix.rs index e571d49..4f73564 100644 --- a/src/terminal/sys/unix.rs +++ b/src/terminal/sys/unix.rs @@ -33,7 +33,9 @@ pub(crate) fn size() -> Result<(u16, u16)> { 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)) } else { tput_size().ok_or_else(|| std::io::Error::last_os_error().into())