add tokio console

This commit is contained in:
John Smith
2022-11-03 11:28:29 -04:00
parent f1bf883376
commit 404f579baa
10 changed files with 221 additions and 11 deletions

View File

@@ -306,11 +306,18 @@ impl UI {
fn run_command(s: &mut Cursive, text: &str) -> Result<(), String> {
// disable ui
Self::enable_command_ui(s, false);
// run command
s.set_global_callback(cursive::event::Event::Key(Key::Esc), |s| {
let cmdproc = Self::command_processor(s);
cmdproc.cancel_command();
});
let cmdproc = Self::command_processor(s);
cmdproc.run_command(
text,
Box::new(|s| {
s.set_global_callback(cursive::event::Event::Key(Key::Esc), UI::quit_handler);
Self::enable_command_ui(s, true);
}),
)