Skip to content

Commit

Permalink
Fix invalid terminal size being returned on Windows (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
AronParker committed Jan 2, 2023
1 parent 1b72810 commit edfc4bb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/windows_term/mod.rs
Expand Up @@ -137,9 +137,10 @@ pub fn terminal_size(out: &Term) -> Option<(u16, u16)> {
return None;
}

let w = (csbi.srWindow.Right - csbi.srWindow.Left + 1) as u16;
let h = (csbi.srWindow.Bottom - csbi.srWindow.Top + 1) as u16;
Some((w, h))
let rows = (csbi.srWindow.Bottom - csbi.srWindow.Top + 1) as u16;
let columns = (csbi.srWindow.Right - csbi.srWindow.Left + 1) as u16;

Some((rows, columns))
}

pub fn move_cursor_to(out: &Term, x: usize, y: usize) -> io::Result<()> {
Expand Down

0 comments on commit edfc4bb

Please sign in to comment.