return to toplevel from a long running query after receiving Ctrl-C

This commit is contained in:
Mark Thom
2019-09-30 13:27:22 -06:00
parent ecb2cc3518
commit b26c5c213e
4 changed files with 35 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ use std::io::{stdout, Read, Write};
use std::mem;
use std::ops::Index;
use std::rc::Rc;
use std::sync::atomic::AtomicBool;
use termion::raw::IntoRawMode;
@@ -54,6 +55,10 @@ pub struct MachinePolicies {
cut_policy: Box<CutPolicy>,
}
lazy_static! {
pub static ref INTERRUPT: AtomicBool = AtomicBool::new(false);
}
impl MachinePolicies {
#[inline]
fn new() -> Self {