diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index ec92a5d44..d65610ef9 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -187,6 +187,9 @@ impl Application { } } Some(payload) = self.editor.debugger_events.next() => { + if self.editor.debugger.is_none() { + continue; + } let mut debugger = self.editor.debugger.as_mut().unwrap(); match payload { Payload::Event(ev) => { diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index f7317f7a7..de1b9890f 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4329,5 +4329,6 @@ fn dap_terminate(cx: &mut Context) { if let Some(debugger) = &mut cx.editor.debugger { let request = debugger.disconnect(); let _ = block_on(request).unwrap(); + cx.editor.debugger = None; } }