parent
44d180cb46
commit
d689d7e8ed
@ -9,7 +9,7 @@ pub fn exit() {
|
|||||||
pub fn get_terminal_size() -> (u16, u16) {
|
pub fn get_terminal_size() -> (u16, u16) {
|
||||||
if let Ok(buffer) = ScreenBuffer::current() {
|
if let Ok(buffer) = ScreenBuffer::current() {
|
||||||
let size = buffer.info().unwrap().terminal_size();
|
let size = buffer.info().unwrap().terminal_size();
|
||||||
(size.width as u16, size.height as u16)
|
(size.width + 1, size.height + 1).into()
|
||||||
} else {
|
} else {
|
||||||
(0, 0)
|
(0, 0)
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,7 @@ impl ITerminal for WinApiTerminal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn terminal_size(&self) -> (u16, u16) {
|
fn terminal_size(&self) -> (u16, u16) {
|
||||||
let csbi = ScreenBuffer::current().unwrap();
|
get_terminal_size()
|
||||||
csbi.info().unwrap().terminal_size().into()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn scroll_up(&self, count: i16) -> Result<()> {
|
fn scroll_up(&self, count: i16) -> Result<()> {
|
||||||
|
Loading…
Reference in New Issue
Block a user