use crossterm::{cursor, execute, terminal};
pub fn get_terminal_size() -> (u16, u16) {
terminal::size().unwrap_or((80, 24))
}
pub fn is_raw_mode() -> bool {
terminal::is_raw_mode_enabled().unwrap_or(false)
}
pub fn clear() {
execute!(std::io::stdout(), terminal::Clear(terminal::ClearType::All)).unwrap();
}
pub fn hide_cursor() {
execute!(std::io::stdout(), cursor::Hide).unwrap();
}
pub fn show_cursor() {
execute!(std::io::stdout(), cursor::Show).unwrap();
}
pub fn move_to(x: u32, y: u32) {
execute!(std::io::stdout(), cursor::MoveTo(x as u16, y as u16)).unwrap();
}
pub fn enable_wrap() {
execute!(std::io::stdout(), terminal::EnableLineWrap).unwrap();
}
pub fn disable_wrap() {
execute!(std::io::stdout(), terminal::DisableLineWrap).unwrap();
}