Przeglądaj źródła

feat: add terminal.commandDelay setting

Add a new configurable setting to control command execution delays in terminals.
When set to a non-zero value, this adds a sleep delay after command execution
via PROMPT_COMMAND in bash/zsh and start-sleep in PowerShell.

The default value is 0, which disables the delay completely. This setting
replaces the previous hardcoded delay of 50ms that was added as a workaround
for VSCode bug #237208.

Fixes: #2017
Signed-off-by: Eric Wheeler <[email protected]>
Eric Wheeler 10 miesięcy temu
rodzic
commit
4d1cfe8141

+ 5 - 1
src/core/webview/ClineProvider.ts

@@ -351,9 +351,10 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
 		}
 
 		// Initialize out-of-scope variables that need to recieve persistent global state values
-		this.getState().then(({ soundEnabled, terminalShellIntegrationTimeout }) => {
+		this.getState().then(({ soundEnabled, terminalShellIntegrationTimeout, terminalCommandDelay }) => {
 			setSoundEnabled(soundEnabled ?? false)
 			Terminal.setShellIntegrationTimeout(terminalShellIntegrationTimeout ?? TERMINAL_SHELL_INTEGRATION_TIMEOUT)
+			Terminal.setCommandDelay(terminalCommandDelay ?? 0)
 		})
 
 		// Initialize tts enabled state
@@ -1197,6 +1198,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
 			writeDelayMs,
 			terminalOutputLineLimit,
 			terminalShellIntegrationTimeout,
+			terminalCommandDelay,
 			fuzzyMatchThreshold,
 			mcpEnabled,
 			enableMcpServerCreation,
@@ -1264,6 +1266,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
 			writeDelayMs: writeDelayMs ?? 1000,
 			terminalOutputLineLimit: terminalOutputLineLimit ?? 500,
 			terminalShellIntegrationTimeout: terminalShellIntegrationTimeout ?? TERMINAL_SHELL_INTEGRATION_TIMEOUT,
+			terminalCommandDelay: terminalCommandDelay ?? 0,
 			fuzzyMatchThreshold: fuzzyMatchThreshold ?? 1.0,
 			mcpEnabled: mcpEnabled ?? true,
 			enableMcpServerCreation: enableMcpServerCreation ?? true,
@@ -1350,6 +1353,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
 			terminalOutputLineLimit: stateValues.terminalOutputLineLimit ?? 500,
 			terminalShellIntegrationTimeout:
 				stateValues.terminalShellIntegrationTimeout ?? TERMINAL_SHELL_INTEGRATION_TIMEOUT,
+			terminalCommandDelay: stateValues.terminalCommandDelay ?? 0,
 			mode: stateValues.mode ?? defaultModeSlug,
 			language: stateValues.language ?? formatLanguage(vscode.env.language),
 			mcpEnabled: stateValues.mcpEnabled ?? true,

+ 7 - 0
src/core/webview/webviewMessageHandler.ts

@@ -736,6 +736,13 @@ export const webviewMessageHandler = async (provider: ClineProvider, message: We
 				Terminal.setShellIntegrationTimeout(message.value)
 			}
 			break
+		case "terminalCommandDelay":
+			await updateGlobalState("terminalCommandDelay", message.value)
+			await provider.postStateToWebview()
+			if (message.value !== undefined) {
+				Terminal.setCommandDelay(message.value)
+			}
+			break
 		case "mode":
 			await provider.handleModeSwitch(message.text as Mode)
 			break

+ 1 - 0
src/exports/roo-code.d.ts

@@ -266,6 +266,7 @@ type GlobalSettings = {
 	maxReadFileLine?: number | undefined
 	terminalOutputLineLimit?: number | undefined
 	terminalShellIntegrationTimeout?: number | undefined
+	terminalCommandDelay?: number | undefined
 	rateLimitSeconds?: number | undefined
 	diffEnabled?: boolean | undefined
 	fuzzyMatchThreshold?: number | undefined

+ 1 - 0
src/exports/types.ts

@@ -269,6 +269,7 @@ type GlobalSettings = {
 	maxReadFileLine?: number | undefined
 	terminalOutputLineLimit?: number | undefined
 	terminalShellIntegrationTimeout?: number | undefined
+	terminalCommandDelay?: number | undefined
 	rateLimitSeconds?: number | undefined
 	diffEnabled?: boolean | undefined
 	fuzzyMatchThreshold?: number | undefined

+ 17 - 0
src/integrations/terminal/Terminal.ts

@@ -7,6 +7,7 @@ export const TERMINAL_SHELL_INTEGRATION_TIMEOUT = 5000
 
 export class Terminal {
 	private static shellIntegrationTimeout: number = TERMINAL_SHELL_INTEGRATION_TIMEOUT
+	private static commandDelay: number = 0
 
 	public terminal: vscode.Terminal
 	public busy: boolean
@@ -260,6 +261,22 @@ export class Terminal {
 		return Terminal.shellIntegrationTimeout
 	}
 
+	/**
+	 * Sets the command delay in milliseconds
+	 * @param delayMs The delay in milliseconds
+	 */
+	public static setCommandDelay(delayMs: number): void {
+		Terminal.commandDelay = delayMs
+	}
+
+	/**
+	 * Gets the command delay in milliseconds
+	 * @returns The command delay in milliseconds
+	 */
+	public static getCommandDelay(): number {
+		return Terminal.commandDelay
+	}
+
 	public static compressTerminalOutput(input: string, lineLimit: number): string {
 		return truncateOutput(applyRunLengthEncoding(input), lineLimit)
 	}

+ 8 - 3
src/integrations/terminal/TerminalProcess.ts

@@ -290,9 +290,14 @@ export class TerminalProcess extends EventEmitter<TerminalProcessEvents> {
 				(defaultWindowsShellProfile === null ||
 					(defaultWindowsShellProfile as string)?.toLowerCase().includes("powershell"))
 			if (isPowerShell) {
-				terminal.shellIntegration.executeCommand(
-					`${command} ; "(Roo/PS Workaround: ${this.terminalInfo.cmdCounter++})" > $null; start-sleep -milliseconds 150`,
-				)
+				let commandToExecute = `${command} ; "(Roo/PS Workaround: ${this.terminalInfo.cmdCounter++})" > $null`
+
+				// Only add the sleep command if the command delay is greater than 0
+				if (Terminal.getCommandDelay() > 0) {
+					commandToExecute += `; start-sleep -milliseconds ${Terminal.getCommandDelay()}`
+				}
+
+				terminal.shellIntegration.executeCommand(commandToExecute)
 			} else {
 				terminal.shellIntegration.executeCommand(command)
 			}

+ 17 - 12
src/integrations/terminal/TerminalRegistry.ts

@@ -109,22 +109,27 @@ export class TerminalRegistry {
 	}
 
 	static createTerminal(cwd: string | vscode.Uri): Terminal {
+		const env: Record<string, string> = {
+			PAGER: "cat",
+
+			// VTE must be disabled because it prevents the prompt command from executing
+			// See https://wiki.gnome.org/Apps/Terminal/VTE
+			VTE_VERSION: "0",
+		}
+
+		// VSCode bug#237208: Command output can be lost due to a race between completion
+		// sequences and consumers. Add delay via PROMPT_COMMAND to ensure the
+		// \x1b]633;D escape sequence arrives after command output is processed.
+		// Only add this if commandDelay is not zero
+		if (Terminal.getCommandDelay() > 0) {
+			env.PROMPT_COMMAND = `sleep ${Terminal.getCommandDelay() / 1000}`
+		}
+
 		const terminal = vscode.window.createTerminal({
 			cwd,
 			name: "Roo Code",
 			iconPath: new vscode.ThemeIcon("rocket"),
-			env: {
-				PAGER: "cat",
-
-				// VSCode bug#237208: Command output can be lost due to a race between completion
-				// sequences and consumers. Add 50ms delay via PROMPT_COMMAND to ensure the
-				// \x1b]633;D escape sequence arrives after command output is processed.
-				PROMPT_COMMAND: "sleep 0.050",
-
-				// VTE must be disabled because it prevents the prompt command above from executing
-				// See https://wiki.gnome.org/Apps/Terminal/VTE
-				VTE_VERSION: "0",
-			},
+			env,
 		})
 
 		const cwdString = cwd.toString()

+ 25 - 1
src/integrations/terminal/__tests__/TerminalRegistry.test.ts

@@ -1,5 +1,6 @@
 // npx jest src/integrations/terminal/__tests__/TerminalRegistry.test.ts
 
+import { Terminal } from "../Terminal"
 import { TerminalRegistry } from "../TerminalRegistry"
 
 // Mock vscode.window.createTerminal
@@ -31,10 +32,33 @@ describe("TerminalRegistry", () => {
 				iconPath: expect.any(Object),
 				env: {
 					PAGER: "cat",
-					PROMPT_COMMAND: "sleep 0.050",
 					VTE_VERSION: "0",
 				},
 			})
 		})
+
+		it("adds PROMPT_COMMAND when Terminal.getCommandDelay() > 0", () => {
+			// Set command delay to 50ms for this test
+			const originalDelay = Terminal.getCommandDelay()
+			Terminal.setCommandDelay(50)
+
+			try {
+				TerminalRegistry.createTerminal("/test/path")
+
+				expect(mockCreateTerminal).toHaveBeenCalledWith({
+					cwd: "/test/path",
+					name: "Roo Code",
+					iconPath: expect.any(Object),
+					env: {
+						PAGER: "cat",
+						PROMPT_COMMAND: "sleep 0.05",
+						VTE_VERSION: "0",
+					},
+				})
+			} finally {
+				// Restore original delay
+				Terminal.setCommandDelay(originalDelay)
+			}
+		})
 	})
 })

+ 2 - 0
src/schemas/index.ts

@@ -532,6 +532,7 @@ export const globalSettingsSchema = z.object({
 
 	terminalOutputLineLimit: z.number().optional(),
 	terminalShellIntegrationTimeout: z.number().optional(),
+	terminalCommandDelay: z.number().optional(),
 
 	rateLimitSeconds: z.number().optional(),
 	diffEnabled: z.boolean().optional(),
@@ -602,6 +603,7 @@ const globalSettingsRecord: GlobalSettingsRecord = {
 
 	terminalOutputLineLimit: undefined,
 	terminalShellIntegrationTimeout: undefined,
+	terminalCommandDelay: undefined,
 
 	rateLimitSeconds: undefined,
 	diffEnabled: undefined,

+ 1 - 0
src/shared/ExtensionMessage.ts

@@ -153,6 +153,7 @@ export type ExtensionState = Pick<
 	// | "maxReadFileLine" // Optional in GlobalSettings, required here.
 	| "terminalOutputLineLimit"
 	| "terminalShellIntegrationTimeout"
+	| "terminalCommandDelay"
 	| "diffEnabled"
 	| "fuzzyMatchThreshold"
 	// | "experiments" // Optional in GlobalSettings, required here.

+ 1 - 0
src/shared/WebviewMessage.ts

@@ -82,6 +82,7 @@ export interface WebviewMessage {
 		| "deleteMessage"
 		| "terminalOutputLineLimit"
 		| "terminalShellIntegrationTimeout"
+		| "terminalCommandDelay"
 		| "mcpEnabled"
 		| "enableMcpServerCreation"
 		| "searchCommits"

+ 3 - 0
webview-ui/src/components/settings/SettingsView.tsx

@@ -129,6 +129,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
 		telemetrySetting,
 		terminalOutputLineLimit,
 		terminalShellIntegrationTimeout,
+		terminalCommandDelay,
 		writeDelayMs,
 		showRooIgnoredFiles,
 		remoteBrowserEnabled,
@@ -237,6 +238,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
 			vscode.postMessage({ type: "screenshotQuality", value: screenshotQuality ?? 75 })
 			vscode.postMessage({ type: "terminalOutputLineLimit", value: terminalOutputLineLimit ?? 500 })
 			vscode.postMessage({ type: "terminalShellIntegrationTimeout", value: terminalShellIntegrationTimeout })
+			vscode.postMessage({ type: "terminalCommandDelay", value: terminalCommandDelay })
 			vscode.postMessage({ type: "mcpEnabled", bool: mcpEnabled })
 			vscode.postMessage({ type: "alwaysApproveResubmit", bool: alwaysApproveResubmit })
 			vscode.postMessage({ type: "requestDelaySeconds", value: requestDelaySeconds })
@@ -481,6 +483,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
 					<TerminalSettings
 						terminalOutputLineLimit={terminalOutputLineLimit}
 						terminalShellIntegrationTimeout={terminalShellIntegrationTimeout}
+						terminalCommandDelay={terminalCommandDelay}
 						setCachedStateField={setCachedStateField}
 					/>
 				</div>

+ 24 - 1
webview-ui/src/components/settings/TerminalSettings.tsx

@@ -12,12 +12,16 @@ import { Section } from "./Section"
 type TerminalSettingsProps = HTMLAttributes<HTMLDivElement> & {
 	terminalOutputLineLimit?: number
 	terminalShellIntegrationTimeout?: number
-	setCachedStateField: SetCachedStateField<"terminalOutputLineLimit" | "terminalShellIntegrationTimeout">
+	terminalCommandDelay?: number
+	setCachedStateField: SetCachedStateField<
+		"terminalOutputLineLimit" | "terminalShellIntegrationTimeout" | "terminalCommandDelay"
+	>
 }
 
 export const TerminalSettings = ({
 	terminalOutputLineLimit,
 	terminalShellIntegrationTimeout,
+	terminalCommandDelay,
 	setCachedStateField,
 	className,
 	...props
@@ -75,6 +79,25 @@ export const TerminalSettings = ({
 						{t("settings:terminal.shellIntegrationTimeout.description")}
 					</div>
 				</div>
+
+				<div>
+					<label className="block font-medium mb-1">{t("settings:terminal.commandDelay.label")}</label>
+					<div className="flex items-center gap-2">
+						<Slider
+							min={0}
+							max={1000}
+							step={10}
+							value={[terminalCommandDelay ?? 0]}
+							onValueChange={([value]) =>
+								setCachedStateField("terminalCommandDelay", Math.min(1000, Math.max(0, value)))
+							}
+						/>
+						<span className="w-10">{terminalCommandDelay ?? 50}ms</span>
+					</div>
+					<div className="text-vscode-descriptionForeground text-sm mt-1">
+						{t("settings:terminal.commandDelay.description")}
+					</div>
+				</div>
 			</Section>
 		</div>
 	)

+ 4 - 0
webview-ui/src/i18n/locales/ca/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "Temps d'espera d'integració de shell del terminal",
 			"description": "Temps màxim d'espera per a la inicialització de la integració de shell abans d'executar comandes. Per a usuaris amb temps d'inici de shell llargs, aquest valor pot necessitar ser augmentat si veieu errors \"Shell Integration Unavailable\" al terminal."
+		},
+		"commandDelay": {
+			"label": "Retard de comanda del terminal",
+			"description": "Retard en mil·lisegons a afegir després de l'execució de la comanda. La configuració predeterminada de 0 desactiva completament el retard. Això pot ajudar a assegurar que la sortida de la comanda es capturi completament en terminals amb problemes de temporització. En la majoria de terminals s'implementa establint `PROMPT_COMMAND='sleep N'` i Powershell afegeix `start-sleep` al final de cada comanda. Originalment era una solució per al error VSCode#237208 i pot no ser necessari."
 		}
 	},
 	"advanced": {

+ 5 - 1
webview-ui/src/i18n/locales/de/settings.json

@@ -300,7 +300,11 @@
 		},
 		"shellIntegrationTimeout": {
 			"label": "Terminal-Shell-Integrationszeit-Limit",
-			"description": "Maximale Wartezeit für die Shell-Integration, bevor Befehle ausgeführt werden. Für Benutzer mit langen Shell-Startzeiten muss dieser Wert möglicherweise erhöht werden, wenn Sie Fehler vom Typ \"Shell Integration Unavailable\" im Terminal sehen."
+			"description": "Maximale Wartezeit für die Shell-Integration, bevor Befehle ausgeführt werden. Für Benutzer mit langen Shell-Startzeiten musst du diesen Wert möglicherweise erhöhen, wenn du Fehler vom Typ \"Shell Integration Unavailable\" im Terminal siehst."
+		},
+		"commandDelay": {
+			"label": "Terminal-Befehlsverzögerung",
+			"description": "Verzögerung in Millisekunden, die nach der Befehlsausführung hinzugefügt wird. Die Standardeinstellung von 0 deaktiviert die Verzögerung vollständig. Dies kann dazu beitragen, dass die Befehlsausgabe in Terminals mit Timing-Problemen vollständig erfasst wird. In den meisten Terminals wird dies durch Setzen von `PROMPT_COMMAND='sleep N'` implementiert, und Powershell fügt `start-sleep` am Ende jedes Befehls hinzu. Ursprünglich war dies eine Lösung für VSCode-Bug#237208 und ist möglicherweise nicht mehr erforderlich."
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/en/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "Terminal shell integration timeout",
 			"description": "Maximum time to wait for shell integration to initialize before executing commands. For users with long shell startup times, this value may need to be increased if you see \"Shell Integration Unavailable\" errors in the terminal."
+		},
+		"commandDelay": {
+			"label": "Terminal command delay",
+			"description": "Delay in milliseconds to add after command execution. The default setting of 0 disables the delay completely. This can help ensure command output is fully captured in terminals with timing issues. In most terminals it is implemented by setting `PROMPT_COMMAND='sleep N'` and Powershell appends `start-sleep` to the end of each command. Originally was workaround for VSCode bug#237208 and may not be needed."
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/es/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "Tiempo de espera de integración del shell del terminal",
 			"description": "Tiempo máximo de espera para la inicialización de la integración del shell antes de ejecutar comandos. Para usuarios con tiempos de inicio de shell largos, este valor puede necesitar ser aumentado si ve errores \"Shell Integration Unavailable\" en el terminal."
+		},
+		"commandDelay": {
+			"label": "Retraso de comando del terminal",
+			"description": "Retraso en milisegundos para añadir después de la ejecución del comando. La configuración predeterminada de 0 desactiva completamente el retraso. Esto puede ayudar a asegurar que la salida del comando se capture completamente en terminales con problemas de temporización. En la mayoría de terminales se implementa estableciendo `PROMPT_COMMAND='sleep N'` y Powershell añade `start-sleep` al final de cada comando. Originalmente era una solución para el error VSCode#237208 y puede no ser necesario."
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/fr/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "Délai d'intégration du shell du terminal",
 			"description": "Temps maximum d'attente pour l'initialisation de l'intégration du shell avant d'exécuter des commandes. Pour les utilisateurs avec des temps de démarrage de shell longs, cette valeur peut nécessiter d'être augmentée si vous voyez des erreurs \"Shell Integration Unavailable\" dans le terminal."
+		},
+		"commandDelay": {
+			"label": "Délai de commande du terminal",
+			"description": "Délai en millisecondes à ajouter après l'exécution de la commande. Le paramètre par défaut de 0 désactive complètement le délai. Cela peut aider à garantir que la sortie de la commande est entièrement capturée dans les terminaux avec des problèmes de synchronisation. Dans la plupart des terminaux, cela est implémenté en définissant `PROMPT_COMMAND='sleep N'` et Powershell ajoute `start-sleep` à la fin de chaque commande. À l'origine, c'était une solution pour le bug VSCode#237208 et peut ne pas être nécessaire."
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/hi/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "टर्मिनल शेल एकीकरण टाइमआउट",
 			"description": "कमांड निष्पादित करने से पहले शेल एकीकरण के आरंभ होने के लिए प्रतीक्षा का अधिकतम समय। लंबे शेल स्टार्टअप समय वाले उपयोगकर्ताओं के लिए, यदि आप टर्मिनल में \"Shell Integration Unavailable\" त्रुटियाँ देखते हैं तो इस मान को बढ़ाने की आवश्यकता हो सकती है।"
+		},
+		"commandDelay": {
+			"label": "टर्मिनल कमांड विलंब",
+			"description": "कमांड निष्पादन के बाद जोड़ने के लिए मिलीसेकंड में विलंब। 0 का डिफ़ॉल्ट सेटिंग विलंब को पूरी तरह से अक्षम कर देता है। यह टाइमिंग समस्याओं वाले टर्मिनलों में कमांड आउटपुट को पूरी तरह से कैप्चर करने में मदद कर सकता है। अधिकांश टर्मिनलों में यह `PROMPT_COMMAND='sleep N'` सेट करके कार्यान्वित किया जाता है और Powershell प्रत्येक कमांड के अंत में `start-sleep` जोड़ता है। मूल रूप से यह VSCode बग#237208 के लिए एक समाधान था और इसकी आवश्यकता नहीं हो सकती है।"
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/it/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "Timeout integrazione shell del terminale",
 			"description": "Tempo massimo di attesa per l'inizializzazione dell'integrazione della shell prima di eseguire i comandi. Per gli utenti con tempi di avvio della shell lunghi, questo valore potrebbe dover essere aumentato se si vedono errori \"Shell Integration Unavailable\" nel terminale."
+		},
+		"commandDelay": {
+			"label": "Ritardo comando terminale",
+			"description": "Ritardo in millisecondi da aggiungere dopo l'esecuzione del comando. L'impostazione predefinita di 0 disabilita completamente il ritardo. Questo può aiutare a garantire che l'output del comando sia catturato completamente nei terminali con problemi di temporizzazione. Nella maggior parte dei terminali viene implementato impostando `PROMPT_COMMAND='sleep N'` e Powershell aggiunge `start-sleep` alla fine di ogni comando. In origine era una soluzione per il bug VSCode#237208 e potrebbe non essere necessario."
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/ja/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "ターミナルシェル統合タイムアウト",
 			"description": "コマンドを実行する前にシェル統合の初期化を待つ最大時間。シェルの起動時間が長いユーザーの場合、ターミナルで「Shell Integration Unavailable」エラーが表示される場合は、この値を増やす必要があるかもしれません。"
+		},
+		"commandDelay": {
+			"label": "ターミナルコマンド遅延",
+			"description": "コマンド実行後に追加する遅延時間(ミリ秒)。デフォルト設定の0は遅延を完全に無効にします。これはタイミングの問題があるターミナルでコマンド出力を完全にキャプチャするのに役立ちます。ほとんどのターミナルでは`PROMPT_COMMAND='sleep N'`を設定することで実装され、PowerShellは各コマンドの最後に`start-sleep`を追加します。元々はVSCodeバグ#237208の回避策で、必要ない場合があります。"
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/ko/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "터미널 쉘 통합 타임아웃",
 			"description": "명령을 실행하기 전에 쉘 통합이 초기화될 때까지 기다리는 최대 시간. 쉘 시작 시간이 긴 사용자의 경우, 터미널에서 \"Shell Integration Unavailable\" 오류가 표시되면 이 값을 늘려야 할 수 있습니다."
+		},
+		"commandDelay": {
+			"label": "터미널 명령 지연",
+			"description": "명령 실행 후 추가할 지연 시간(밀리초). 기본값 0은 지연을 완전히 비활성화합니다. 이는 타이밍 문제가 있는 터미널에서 명령 출력을 완전히 캡처하는 데 도움이 될 수 있습니다. 대부분의 터미널에서는 `PROMPT_COMMAND='sleep N'`을 설정하여 구현되며, PowerShell은 각 명령 끝에 `start-sleep`을 추가합니다. 원래는 VSCode 버그#237208에 대한 해결책이었으며 필요하지 않을 수 있습니다."
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/pl/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "Limit czasu integracji powłoki terminala",
 			"description": "Maksymalny czas oczekiwania na inicjalizację integracji powłoki przed wykonaniem poleceń. Dla użytkowników z długim czasem uruchamiania powłoki, ta wartość może wymagać zwiększenia, jeśli widzisz błędy \"Shell Integration Unavailable\" w terminalu."
+		},
+		"commandDelay": {
+			"label": "Opóźnienie poleceń terminala",
+			"description": "Opóźnienie w milisekundach dodawane po wykonaniu polecenia. Domyślne ustawienie 0 całkowicie wyłącza opóźnienie. Może to pomóc w zapewnieniu pełnego przechwytywania wyjścia poleceń w terminalach z problemami z synchronizacją. W większości terminali jest to implementowane przez ustawienie `PROMPT_COMMAND='sleep N'`, a PowerShell dodaje `start-sleep` na końcu każdego polecenia. Pierwotnie było to obejście błędu VSCode#237208 i może nie być potrzebne."
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/pt-BR/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "Tempo limite de integração do shell do terminal",
 			"description": "Tempo máximo de espera para a inicialização da integração do shell antes de executar comandos. Para usuários com tempos de inicialização de shell longos, este valor pode precisar ser aumentado se você vir erros \"Shell Integration Unavailable\" no terminal."
+		},
+		"commandDelay": {
+			"label": "Atraso de comando do terminal",
+			"description": "Atraso em milissegundos para adicionar após a execução do comando. A configuração padrão de 0 desativa completamente o atraso. Isso pode ajudar a garantir que a saída do comando seja totalmente capturada em terminais com problemas de temporização. Na maioria dos terminais, isso é implementado definindo `PROMPT_COMMAND='sleep N'` e o PowerShell adiciona `start-sleep` ao final de cada comando. Originalmente era uma solução para o bug VSCode#237208 e pode não ser necessário."
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/tr/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "Terminal kabuk entegrasyonu zaman aşımı",
 			"description": "Komutları yürütmeden önce kabuk entegrasyonunun başlatılması için beklenecek maksimum süre. Kabuk başlatma süresi uzun olan kullanıcılar için, terminalde \"Shell Integration Unavailable\" hatalarını görürseniz bu değerin artırılması gerekebilir."
+		},
+		"commandDelay": {
+			"label": "Terminal komut gecikmesi",
+			"description": "Komut yürütmesinden sonra eklenecek gecikme süresi (milisaniye). 0 varsayılan ayarı gecikmeyi tamamen devre dışı bırakır. Bu, zamanlama sorunları olan terminallerde komut çıktısının tam olarak yakalanmasını sağlamaya yardımcı olabilir. Çoğu terminalde bu, `PROMPT_COMMAND='sleep N'` ayarlanarak uygulanır ve PowerShell her komutun sonuna `start-sleep` ekler. Başlangıçta VSCode hata#237208 için bir geçici çözümdü ve gerekli olmayabilir."
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/vi/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "Thời gian chờ tích hợp shell terminal",
 			"description": "Thời gian tối đa để chờ tích hợp shell khởi tạo trước khi thực hiện lệnh. Đối với người dùng có thời gian khởi động shell dài, giá trị này có thể cần được tăng lên nếu bạn thấy lỗi \"Shell Integration Unavailable\" trong terminal."
+		},
+		"commandDelay": {
+			"label": "Độ trễ lệnh terminal",
+			"description": "Độ trễ tính bằng mili giây để thêm vào sau khi thực hiện lệnh. Cài đặt mặc định là 0 sẽ tắt hoàn toàn độ trễ. Điều này có thể giúp đảm bảo đầu ra lệnh được ghi lại đầy đủ trong các terminal có vấn đề về thời gian. Trong hầu hết các terminal, điều này được thực hiện bằng cách đặt `PROMPT_COMMAND='sleep N'` và PowerShell thêm `start-sleep` vào cuối mỗi lệnh. Ban đầu là giải pháp cho lỗi VSCode#237208 và có thể không cần thiết."
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/zh-CN/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "终端初始化等待时间",
 			"description": "执行命令前等待 Shell 集成初始化的最长时间。对于 Shell 启动时间较长的用户,如果在终端中看到\"Shell Integration Unavailable\"错误,可能需要增加此值。"
+		},
+		"commandDelay": {
+			"label": "终端命令延迟",
+			"description": "命令执行后添加的延迟时间(毫秒)。默认设置为 0 时完全禁用延迟。这可以帮助确保在有计时问题的终端中完全捕获命令输出。在大多数终端中,这是通过设置 `PROMPT_COMMAND='sleep N'` 实现的,而 PowerShell 会在每个命令末尾添加 `start-sleep`。最初是为了解决 VSCode 错误#237208,现在可能不再需要。"
 		}
 	},
 	"advanced": {

+ 4 - 0
webview-ui/src/i18n/locales/zh-TW/settings.json

@@ -301,6 +301,10 @@
 		"shellIntegrationTimeout": {
 			"label": "終端機 Shell 整合逾時",
 			"description": "執行命令前等待 Shell 整合初始化的最長時間。如果您的 Shell 啟動較慢,且終端機出現「Shell 整合無法使用」的錯誤訊息,可能需要提高此數值。"
+		},
+		"commandDelay": {
+			"label": "終端機命令延遲",
+			"description": "命令執行後添加的延遲時間(毫秒)。預設值為 0 時完全停用延遲。這可以幫助確保在有計時問題的終端機中完整擷取命令輸出。在大多數終端機中,這是透過設定 `PROMPT_COMMAND='sleep N'` 實現的,而 PowerShell 會在每個命令結尾加入 `start-sleep`。最初是為了解決 VSCode 錯誤#237208,現在可能不再需要。"
 		}
 	},
 	"advanced": {