aboutsummaryrefslogtreecommitdiff
path: root/src/term
diff options
context:
space:
mode:
Diffstat (limited to 'src/term')
-rw-r--r--src/term/mod.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 979999a9..da5683e0 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -23,6 +23,20 @@ use grid::{Grid, ClearRegion};
use index::{Cursor, Column, Line};
use ansi::{Color, NamedColor};
+use tty::ToWinsize;
+use libc::{self, winsize};
+
+impl<'a> ToWinsize for &'a SizeInfo {
+ fn to_winsize(&self) -> winsize {
+ winsize {
+ ws_row: self.lines().0 as libc::c_ushort,
+ ws_col: self.cols().0 as libc::c_ushort,
+ ws_xpixel: self.width as libc::c_ushort,
+ ws_ypixel: self.height as libc::c_ushort,
+ }
+ }
+}
+
pub mod cell;
pub use self::cell::Cell;