дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-28 21:42:27 +02:00
Debug session tabs had no close button, and ending a session only marked it terminated, so every session stayed in the strip and Cmd+W fell through to hiding the window. Each tab can now be closed: a running session asks before it is terminated (the Run tab's question, shared through the workbench), then the session, its children and its console are dropped and the tab on the left is selected. Co-authored-by: payailk <[email protected]>
27 рядки
875 B
TypeScript
27 рядки
875 B
TypeScript
import { tx } from "@/platform/i18n";
|
|
import { call, commands, isTauri } from "@/platform/ipc";
|
|
import { loadSettings } from "@/platform/project";
|
|
import { confirmChecked } from "./messages";
|
|
|
|
/**
|
|
* IDEA's question before closing a Run or Debug tab whose process still runs (asked while
|
|
* `run.confirmTerminate` is on). Resolves true for Terminate.
|
|
*/
|
|
export async function confirmTerminate(name: string): Promise<boolean> {
|
|
const answer = await confirmChecked({
|
|
title: tx`Process '${name}' Is Running`,
|
|
message: tx`Do you want to terminate the process '${name}'?`,
|
|
ok: "Terminate",
|
|
checkbox: "Do not ask again",
|
|
});
|
|
if (answer?.checked && isTauri()) {
|
|
try {
|
|
await call(commands.settingsSet("global", "run.confirmTerminate", "false"));
|
|
await loadSettings();
|
|
} catch {
|
|
/* keep asking */
|
|
}
|
|
}
|
|
return answer !== null;
|
|
}
|