From 95cef714902bbcbdc3ef016457e7a77d38293ea8 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Mon, 22 Jul 2024 16:31:12 +0100 Subject: feat(gui): background terminals and more (#2303) * fixes & allow for background terminals to stay running * status indicators etc --- ui/backend/src/run/pty.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'ui/backend/src') diff --git a/ui/backend/src/run/pty.rs b/ui/backend/src/run/pty.rs index 819dc7d0..2af617dd 100644 --- a/ui/backend/src/run/pty.rs +++ b/ui/backend/src/run/pty.rs @@ -86,9 +86,17 @@ pub(crate) async fn pty_kill( pid: uuid::Uuid, state: tauri::State<'_, AtuinState>, ) -> Result<(), String> { - let pty = state.pty_sessions.write().await.remove(&pid).unwrap(); - pty.kill_child().await.map_err(|e|e.to_string())?; - println!("RIP {pid:?}"); + let pty = state.pty_sessions.write().await.remove(&pid); + + match pty { + Some(pty)=>{ + + pty.kill_child().await.map_err(|e|e.to_string())?; + println!("RIP {pid:?}"); + } + None=>{} + } + Ok(()) } -- cgit v1.3.1