From 15501132916dfbc24f23b619e6d5408f258fc0d9 Mon Sep 17 00:00:00 2001 From: Jonas Maier <> Date: Wed, 11 Mar 2026 12:30:07 +0100 Subject: can wait for threads & processes with a timeout now --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 897cdb9..a7138f7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,6 +15,7 @@ use std::time::Duration; pub mod basedir; pub mod completion; +pub mod ctrlc; pub mod cursor; pub mod date; pub mod defer; @@ -27,11 +28,13 @@ pub mod raw; pub mod reload; pub mod run; pub mod serialization; +pub mod wait; use linebuf::LineBuf; use raw::*; use crate::completion::PathCache; +use crate::ctrlc::CtrlC; use crate::cursor::{Direction, move_cursor}; use crate::history::HistoryEntry; use crate::parse::{Ast, PreExpansion}; @@ -82,6 +85,7 @@ pub struct Session { funs: HashMap>, socket_running: Option, path_cache: PathCache, + ctrlc: CtrlC, /// n before end of history.len() /// 0 == not checking history @@ -278,6 +282,7 @@ fn event_loop() { vars: HashMap::new(), funs: HashMap::new(), path_cache: Default::default(), + ctrlc: Default::default(), }; print!("{}", se.prompt()); @@ -286,6 +291,7 @@ fn event_loop() { completion::populate_path_cache(session.clone()); let _sock_dropper = export_fun::listen(session.clone()); + let _ctrlc = ctrlc::setup(session.clone()); loop { let mut buf = [0u8; 1]; -- cgit v1.2.3