pub(crate) const USE_MAIN_SCREEN: &str = "\x1b[?1049l";
pub(crate) const USE_ALTERNATE_SCREEN: &str = "\x1b[?1049h";
pub(crate) const RESET: &str = "\x1b[m";
pub(crate) const WBG: &str = "\x1b[7m";
pub(crate) const MOVE_CURSOR_TO_START: &str = "\x1b[H";
pub(crate) const HIDE_CURSOR: &str = "\x1b[?25l";
pub(crate) const SHOW_CURSOR: &str = "\x1b[?25h";
pub(crate) const CLEAR_LINE_RIGHT_OF_CURSOR: &str = "\x1b[K";
pub(crate) const DEVICE_STATUS_REPORT: &str = "\x1b[6n";
pub(crate) const REPOSITION_CURSOR_END: &str = "\x1b[999C\x1b[999B";
pub(crate) fn push_colored(buffer: &mut String, color: &str, message: &str, use_color: bool) {
for s in &[if use_color { color } else { "" }, message, if use_color { RESET } else { "" }] {
buffer.push_str(s);
}
}