use std::{
cmp::*,
io::{self, Write},
};
#[repr(u8)]
#[derive(Clone, Copy, Debug)]
pub enum ConEmuProgressState {
Remove = 0,
Percent = 1,
Error = 2,
Indeterminate = 3,
Pause = 4,
}
impl ConEmuProgressState {
pub fn write(&self, percent: u8) {
write!(&mut io::stderr(), "\x1b]9;4;{};{}\x07", *self as u8, min(percent, 100)).expect("write ConEmu OSC 9;4");
}
}