Skip to content

Commit

Permalink
Windows terminal size now gets the correct handle
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Nov 13, 2020
1 parent 2d9269c commit 59ed72b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ansi-parsing = ["regex"]
[dependencies]
lazy_static = "1"
libc = "0.2"
terminal_size = "0.1.13"
terminal_size = "0.1.14"
regex = { version = "1.3.1", optional = true, default-features = false, features = ["std"] }
unicode-width = { version = "0.1", optional = true }

Expand Down
3 changes: 1 addition & 2 deletions src/windows_term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ unsafe fn console_on_any(fds: &[DWORD]) -> bool {

#[inline]
pub fn terminal_size(_out: &Term) -> Option<(u16, u16)> {
// TODO: Use term target for getting size
terminal_size::terminal_size().map(|x| ((x.1).0, (x.0).0))
terminal_size::terminal_size_using_handle(out.as_raw_handle()).map(|x| ((x.1).0, (x.0).0))
}

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

0 comments on commit 59ed72b

Please sign in to comment.