@@ -276,8 +276,21 @@ impl Application {
276 debugger.is_running = false;
276 debugger.is_running = false;
278 // whichever thread stops is made "current" (if no previously selected thread).
278 // whichever thread stops is made "current" (if no previously selected thread).
279− if let Some(thread_id) = thread_id {
279+ if thread_id.is_none() || all_threads_stopped.unwrap_or_default() {
280+ let main = debugger.threads().await.ok().and_then(|threads| {
281+ // Workaround for debugging Go tests. Main thread has * in beginning of its name
283+ threads.iter().find(|t| t.name.starts_with('*')).cloned();
285+ main = threads.get(0).cloned();
289+ if let Some(id) = main {
290+ select_thread_id(&mut self.editor, id, false).await;
280− select_thread_id(&mut self.editor, thread_id, false).await;
293+ select_thread_id(&mut self.editor, thread_id.unwrap(), false).await;
283 let scope = match thread_id {
296 let scope = match thread_id {