дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
fix(run): keep Stop in effect until the process is really gone (#1763)
Stop flipped the session back to Run as soon as the direct child exited, but a shell, Maven or the debug adapter can exit while the application it started still holds its port, so the next Run failed with "port already in use". The console also went quiet on a debug Stop because the DAP session was disconnected before java-debug drained the program's output, and closing a window killed running programs with SIGKILL at once. Run and Debug sessions now stay in a stopping state from the Stop press until the whole process group (or the debuggee's pid tree) is gone. As in IntelliJ IDEA, the first Stop only interrupts and waits, and a second Stop kills; the Stop button turns into Kill process meanwhile. A rerun or restart waits for the old process without a time limit, and the termination time limit setting now only bounds a configuration's stop command. Debug launches record the program pid from the adapter's process/processid event, signal its pid tree and keep the adapter attached until the program exits; closing a project also stops debug sessions under its root. Closing a window with running programs shows a Terminating panel with Kill process and closes once they are gone. Co-authored-by: misswell <[email protected]>
Цей коміт міститься в:
1 джерело
7965d171f0
коміт
438ab158ad
37 files changed
+999
-77
No files matched your search
@@ -34,7 +34,7 @@ import { flashTaskbarForBreakpoint, stopTaskbarFlash } from "./taskbarFlash";
|
||||
import { missingAdapter } from "./missingAdapter";
|
||||
import { startFailureMessage } from "./startFailure";
|
||||
|
||||
export type SessionStatus = "starting" | "running" | "paused" | "terminated";
|
||||
export type SessionStatus = "starting" | "running" | "paused" | "stopping" | "terminated";
|
||||
|
||||
export interface DebugSession {
|
||||
id: DebugSessionId;
|
||||
@@ -328,6 +328,7 @@ export function publishContext() {
|
||||
configId: session.runConfig?.id ?? null,
|
||||
name: session.runConfig?.name ?? session.name,
|
||||
startedAt: session.startedAt ?? 0,
|
||||
status: session.status,
|
||||
paused: !!paused,
|
||||
rerun: session.runConfig || session.launch ? () => void rerunSession(session.id) : null,
|
||||
stop: () => void stopSession(session.id),
|
||||
@@ -663,6 +664,12 @@ export async function stopSession(id: DebugSessionId, options: { stopProcess?: b
|
||||
markTerminated(root.id);
|
||||
return;
|
||||
}
|
||||
// Between the Stop press and the adapter's terminated event the session is shutting down:
|
||||
// keep it live (Run stays disabled) and let the toolbar show the spinner.
|
||||
for (const sid of new Set([root.id, s.id])) {
|
||||
const target = useDebug.getState().sessions[sid];
|
||||
if (target && isLive(target)) patch(sid, { status: "stopping" });
|
||||
}
|
||||
try {
|
||||
await call(commands.debugStop(root.id));
|
||||
} catch (e) {
|
||||
|
||||
Reference in new issue
Заблокувати користувача