extern crate terminal_escapes; use std::io::Write; use terminal_escapes::{ Device, Attribute::*, Color }; fn main() -> std::io::Result<()> { let stdin = std::io::stdin(); let stdout = std::io::stdout(); let mut device = Device::new(stdin, stdout); device.set_attributes(&[Background(Color::Red)]); let (row, column) = device.cursor_position()?; println!("cursor position is ({}, {})", row, column); device.set_attributes(&[Default]); device.flush(); Ok(()) }