use super::base::ESC;
pub const HOME: &str = "H";
pub const UP: &str = "A";
pub const DOWN: &str = "B";
pub const RIGHT: &str = "C";
pub const LEFT: &str = "D";
pub const BNL: &str = "E";
pub const BPL: &str = "F";
pub const COL: &str = "G";
pub const OLUP: &str = "M";
pub const DSCP: &str = "7";
pub const DRSCP: &str = "8";
pub const SSCP: &str = "s";
pub const SRSCP: &str = "u";
pub const POS: &str = "6n";
pub fn move_to_home() -> String {
return format!("{}{}", ESC, HOME);
}
pub fn move_to(line: u64, column: u64) -> String {
return format!("{}{};{}{}", ESC, line, column, HOME);
}
pub fn move_up(line: u64) -> String {
return format!("{}{}{}", ESC, line, UP);
}
pub fn move_down(line: u64) -> String {
return format!("{}{}{}", ESC, line, DOWN);
}
pub fn move_left(column: u64) -> String {
return format!("{}{}{}", ESC, column, LEFT);
}
pub fn move_right(column: u64) -> String {
return format!("{}{}{}", ESC, column, RIGHT);
}
pub fn move_to_bnl(column: u64) -> String {
return format!("{}{}{}", ESC, column, BNL);
}
pub fn move_to_bpl(column: u64) -> String {
return format!("{}{}{}", ESC, column, BPL);
}
pub fn request_position() -> String {
return format!("{}{}", ESC, POS);
}
pub fn move_to_col(column: u64) -> String {
return format!("{}{}{}", ESC, column, COL);
}
pub fn move_one_line_up() -> String {
return format!("{} {}", ESC.replace("[", ""), OLUP);
}
pub fn dec_save_position() -> String {
return format!("{} {}", ESC.replace("[", ""), DSCP);
}
pub fn dec_restore_position() -> String {
return format!("{} {}", ESC.replace("[", ""), DRSCP);
}
pub fn sco_save_position() -> String {
return format!("{}{}", ESC, SSCP);
}
pub fn sco_restore_position() -> String {
return format!("{}{}", ESC, SRSCP);
}