diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index 18fe5661..117b19f0 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -109,10 +109,19 @@ pub fn listen_for_commands(wm: Arc>) { tracing::info!("listening on komorebi.sock"); for client in listener.incoming() { match client { - Ok(stream) => match read_commands_uds(&wm, stream) { - Ok(()) => {} - Err(error) => tracing::error!("{}", error), - }, + Ok(stream) => { + let wm_clone = wm.clone(); + std::thread::spawn(move || { + match stream.set_read_timeout(Some(Duration::from_secs(1))) { + Ok(()) => {} + Err(error) => tracing::error!("{}", error), + } + match read_commands_uds(&wm_clone, stream) { + Ok(()) => {} + Err(error) => tracing::error!("{}", error), + } + }); + } Err(error) => { tracing::error!("{}", error); break;