diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2023-12-27 09:52:27 -0800 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2023-12-27 09:52:27 -0800 |
| commit | c280882749e4126e8863e1e9869e16c5c46197a7 (patch) | |
| tree | 365a9d7c9bd4da2469e797a383f84be0a1d17d92 /src/tiocgwinsz.rs | |
| parent | Use stdout to get terminal size. (diff) | |
| download | editor-c280882749e4126e8863e1e9869e16c5c46197a7.tar.zst | |
Rename tiocgwinsz.rs to term.rs.
I will be putting more functionality in this file.
Diffstat (limited to 'src/tiocgwinsz.rs')
| -rw-r--r-- | src/tiocgwinsz.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/tiocgwinsz.rs b/src/tiocgwinsz.rs deleted file mode 100644 index f8246fd..0000000 --- a/src/tiocgwinsz.rs +++ /dev/null @@ -1,18 +0,0 @@ -use libc::{c_int, winsize}; - -pub fn size() -> Option<winsize> { - let mut window: winsize = winsize { - ws_row: 0, - ws_col: 0, - ws_xpixel: 0, - ws_ypixel: 0, - }; - let result: c_int; - unsafe { - result = libc::ioctl(1, libc::TIOCGWINSZ, &mut window); - } - if result < 0 { - return None; - } - return Some(window); -} |
