From 289a8bf1ce25fe96f58f8dcbd7eb0416c064f9de Mon Sep 17 00:00:00 2001
From: Neil <4138956+nwparker@users.noreply.github.com>
Date: Fri, 18 Sep 2026 20:52:22 -0700
Subject: [PATCH] feat(settings): confirm before stopping running terminals
(#21569)
* feat(settings): confirm before stopping running terminals
* fix(settings): localize close confirmation search keywords
* ci: rerun PR checks after localization fix
* fix(settings): add search keyword translations
---
.../components/settings/GeneralPane.test.ts | 6 ++++
.../src/components/settings/GeneralPane.tsx | 29 +++++++++++++++++++
.../src/components/settings/general-search.ts | 22 ++++++++++++++
.../terminal-pane/CloseTerminalDialog.tsx | 8 +++++
.../RunningTerminalCloseDialog.test.tsx | 3 ++
src/renderer/src/i18n/locales/en.json | 12 +++++++-
6 files changed, 79 insertions(+), 1 deletion(-)
diff --git a/src/renderer/src/components/settings/GeneralPane.test.ts b/src/renderer/src/components/settings/GeneralPane.test.ts
index b17fd3a62dc..482fc1df787 100644
--- a/src/renderer/src/components/settings/GeneralPane.test.ts
+++ b/src/renderer/src/components/settings/GeneralPane.test.ts
@@ -109,6 +109,12 @@ describe('GeneralPane search entries', () => {
expect(matchesSettingsSearch('red underline', entries)).toBe(true)
})
+ it('makes the running-terminal confirmation setting searchable', () => {
+ const entries = getGeneralPaneSearchEntries()
+
+ expect(matchesSettingsSearch('running', entries)).toBe(true)
+ })
+
it('omits the default project runtime setting when Windows runtimes are unsupported', () => {
const entries = getGeneralPaneSearchEntries({ includeProjectRuntime: false })
diff --git a/src/renderer/src/components/settings/GeneralPane.tsx b/src/renderer/src/components/settings/GeneralPane.tsx
index ba7847f7ce0..b141eb6c9f4 100644
--- a/src/renderer/src/components/settings/GeneralPane.tsx
+++ b/src/renderer/src/components/settings/GeneralPane.tsx
@@ -158,6 +158,35 @@ export function GeneralPane({
}
/>
+
+ {translate( + 'auto.components.terminal.pane.CloseTerminalDialog.automatic_resume_warning', + 'This terminal will not resume automatically. Cancel and put the workspace to sleep to resume it later.' + )} +
+ ) : null} {trimmedTabLabel ? ({trimmedTabLabel} diff --git a/src/renderer/src/components/terminal-pane/RunningTerminalCloseDialog.test.tsx b/src/renderer/src/components/terminal-pane/RunningTerminalCloseDialog.test.tsx index 77414531776..c9918a1ee72 100644 --- a/src/renderer/src/components/terminal-pane/RunningTerminalCloseDialog.test.tsx +++ b/src/renderer/src/components/terminal-pane/RunningTerminalCloseDialog.test.tsx @@ -109,6 +109,9 @@ describe('RunningTerminalCloseDialog', () => { await renderDialog({ onConfirm: vi.fn(), copyKind: 'agent' }, updateSettings) expect(document.body.textContent).toContain('Stop this agent?') + expect(document.body.textContent).toContain( + 'This terminal will not resume automatically. Cancel and put the workspace to sleep to resume it later.' + ) expect(getButton('Stop Agent')).toBeTruthy() }) diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 39acaef0a1d..c51120958b7 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -3145,6 +3145,7 @@ }, "pane": { "CloseTerminalDialog": { + "automatic_resume_warning": "This terminal will not resume automatically. Cancel and put the workspace to sleep to resume it later.", "ebd2fa844d": "Close", "1d1a7a9c1f": "Cancel", "6b9a6975f8": "The terminal still has a running process. If you close the terminal, the process will be killed.", @@ -7217,6 +7218,8 @@ "configureProxy": "Configure proxy" }, "GeneralPane": { + "confirm_running_terminal_close": "Confirm before closing running terminals", + "confirm_running_terminal_close_description": "Ask before stopping a running agent or command when closing a terminal.", "d58fccfd84": "Navigation", "5cb5475664": "Confirm before closing pinned tabs", "36b2a5dc6d": "Show a confirmation dialog before a pinned tab is closed.", @@ -9757,7 +9760,14 @@ "sidebar": "sidebar", "867dddea41": "pinned", "5250cf0e48": "pin", - "afa37a34e1": "close" + "afa37a34e1": "close", + "running_terminal": "running", + "terminal": "terminal", + "agent": "agent", + "command": "command", + "confirm": "confirm", + "close": "close", + "omp": "OMP" } }, "git": {