Skip to content

Commit

Permalink
Fix issues caused by previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Apr 26, 2020
1 parent 5b84900 commit 5e75ff1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/common_term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ use std::io;

use crate::term::Term;

#[inline]
pub fn terminal_size() -> Option<(u16, u16)> {
terminal_size::terminal_size().map(|x| ((x.0).0, (x.1).0))
}

pub fn move_cursor_down(out: &Term, n: usize) -> io::Result<()> {
if n > 0 {
out.write_str(&format!("\x1b[{}B", n))
Expand Down
5 changes: 5 additions & 0 deletions src/unix_term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ pub fn is_a_terminal(out: &Term) -> bool {
unsafe { libc::isatty(out.as_raw_fd()) != 0 }
}

#[inline]
pub fn terminal_size() -> Option<(u16, u16)> {
terminal_size::terminal_size().map(|x| ((x.0).0, (x.1).0))
}

pub fn read_secure() -> io::Result<String> {
let f_tty;
let fd = unsafe {
Expand Down
2 changes: 1 addition & 1 deletion src/windows_term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ unsafe fn console_on_any(fds: &[DWORD]) -> bool {

#[inline]
pub fn terminal_size() -> Option<(u16, u16)> {
common_term::terminal_size()
terminal_size::terminal_size().map(|x| ((x.0).0, (x.1).0))
}

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

0 comments on commit 5e75ff1

Please sign in to comment.