Skip to content

Commit

Permalink
Terminal size to 1-based (#170) (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
natbraun authored and TimonPost committed Jul 9, 2019
1 parent 44d180c commit d689d7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crossterm_terminal/src/sys/winapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn exit() {
pub fn get_terminal_size() -> (u16, u16) {
if let Ok(buffer) = ScreenBuffer::current() {
let size = buffer.info().unwrap().terminal_size();
(size.width as u16, size.height as u16)
(size.width + 1, size.height + 1).into()
} else {
(0, 0)
}
Expand Down
3 changes: 1 addition & 2 deletions crossterm_terminal/src/terminal/winapi_terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ impl ITerminal for WinApiTerminal {
}

fn terminal_size(&self) -> (u16, u16) {
let csbi = ScreenBuffer::current().unwrap();
csbi.info().unwrap().terminal_size().into()
get_terminal_size()
}

fn scroll_up(&self, count: i16) -> Result<()> {
Expand Down

0 comments on commit d689d7e

Please sign in to comment.