Support ColorRequest and PtyWrite events
This commit is contained in:
parent
8dd05ab64e
commit
0894a0ba3c
12
src/main.rs
12
src/main.rs
|
@ -455,8 +455,18 @@ impl App {
|
|||
pub fn update(&mut self) {
|
||||
while let Ok(event) = self.term_events.try_recv() {
|
||||
match event {
|
||||
TermEvent::Exit => self.should_quit = true,
|
||||
TermEvent::ColorRequest(index, format) => {
|
||||
let color = self.graphics.colors[index].unwrap_or(Rgb {
|
||||
r: 255,
|
||||
g: 0,
|
||||
b: 255,
|
||||
});
|
||||
|
||||
self.send_input(&format(color));
|
||||
}
|
||||
TermEvent::PtyWrite(text) => self.send_input(&text),
|
||||
TermEvent::Wakeup => self.redraw(),
|
||||
TermEvent::Exit => self.should_quit = true,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue