aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2023-12-27 09:44:05 -0800
committerRose Hogenson <rosehogenson@posteo.net>2023-12-27 09:44:05 -0800
commitd754bf29a7f6c60bb3617518bc72c0f17a36fe50 (patch)
tree8ea54ec0d58432ffcead23220069cc5ea888b9dc
parentPrint the first n lines of the file. (diff)
downloadeditor-d754bf29a7f6c60bb3617518bc72c0f17a36fe50.tar.zst
Use stdout to get terminal size.
-rw-r--r--src/tiocgwinsz.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tiocgwinsz.rs b/src/tiocgwinsz.rs
index 9fdf9a4..f8246fd 100644
--- a/src/tiocgwinsz.rs
+++ b/src/tiocgwinsz.rs
@@ -9,7 +9,7 @@ pub fn size() -> Option<winsize> {
};
let result: c_int;
unsafe {
- result = libc::ioctl(0, libc::TIOCGWINSZ, &mut window);
+ result = libc::ioctl(1, libc::TIOCGWINSZ, &mut window);
}
if result < 0 {
return None;