browse: use Alacritty locking escape sequences

TODO: extract this into a backend crate
This commit is contained in:
FliegendeWurst 2021-06-11 16:15:35 +02:00 committed by Arne Keller
parent 316ac357a3
commit 2aca3bd8d5

View File

@ -427,10 +427,15 @@ fn show_listing(mailbox: &str) -> Result<()> {
tree.on_event(Event::Key(Key::End)) tree.on_event(Event::Key(Key::End))
}).unwrap().process(&mut siv); }).unwrap().process(&mut siv);
siv.refresh(); siv.refresh();
siv.backend.as_any_mut().downcast_mut::<cursive::backends::termion::Backend>().unwrap().terminal.get_mut().write_all(&[b'\x1b', b'\x50', b't', b'm', b'u', b'x', b';', b'\x1b', b'\x1b', b'\x50', b'=', b'2', b's', b'\x1b', b'\x1b', b'\x5c', b'\x1b', b'\\']).unwrap();
siv.backend.as_any_mut().downcast_mut::<cursive::backends::termion::Backend>().unwrap().terminal.get_mut().flush().unwrap();
*siv.backend.as_any_mut().downcast_mut::<cursive::backends::termion::Backend>().unwrap().locked.get_mut() = false;
while siv.is_running() { while siv.is_running() {
siv.step(); while !siv.step() {}
siv.backend.as_any_mut().downcast_mut::<cursive::backends::termion::Backend>().unwrap().terminal.get_mut().write_all(&[b'\x1b', b'\x50', b't', b'm', b'u', b'x', b';', b'\x1b', b'\x1b', b'\x50', b'=', b'2', b's', b'\x1b', b'\x1b', b'\x5c', b'\x1b', b'\\']).unwrap();
siv.backend.as_any_mut().downcast_mut::<cursive::backends::termion::Backend>().unwrap().terminal.get_mut().flush().unwrap();
*siv.backend.as_any_mut().downcast_mut::<cursive::backends::termion::Backend>().unwrap().locked.get_mut() = false;
} }
Ok(()) Ok(())
} }