diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index df2a45442c3..66f7a4ef0ee 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -351,10 +351,29 @@ export class ClineProvider extends EventEmitter implements } // Initialize out-of-scope variables that need to recieve persistent global state values - this.getState().then(({ soundEnabled, terminalShellIntegrationTimeout }) => { - setSoundEnabled(soundEnabled ?? false) - Terminal.setShellIntegrationTimeout(terminalShellIntegrationTimeout ?? TERMINAL_SHELL_INTEGRATION_TIMEOUT) - }) + this.getState().then( + ({ + soundEnabled, + terminalShellIntegrationTimeout, + terminalCommandDelay, + terminalZshClearEolMark, + terminalZshOhMy, + terminalZshP10k, + terminalPowershellCounter, + terminalZdotdir, + }) => { + setSoundEnabled(soundEnabled ?? false) + Terminal.setShellIntegrationTimeout( + terminalShellIntegrationTimeout ?? TERMINAL_SHELL_INTEGRATION_TIMEOUT, + ) + Terminal.setCommandDelay(terminalCommandDelay ?? 0) + Terminal.setTerminalZshClearEolMark(terminalZshClearEolMark ?? true) + Terminal.setTerminalZshOhMy(terminalZshOhMy ?? false) + Terminal.setTerminalZshP10k(terminalZshP10k ?? false) + Terminal.setPowershellCounter(terminalPowershellCounter ?? false) + Terminal.setTerminalZdotdir(terminalZdotdir ?? false) + }, + ) // Initialize tts enabled state this.getState().then(({ ttsEnabled }) => { @@ -1197,6 +1216,12 @@ export class ClineProvider extends EventEmitter implements writeDelayMs, terminalOutputLineLimit, terminalShellIntegrationTimeout, + terminalCommandDelay, + terminalPowershellCounter, + terminalZshClearEolMark, + terminalZshOhMy, + terminalZshP10k, + terminalZdotdir, fuzzyMatchThreshold, mcpEnabled, enableMcpServerCreation, @@ -1264,6 +1289,12 @@ export class ClineProvider extends EventEmitter implements writeDelayMs: writeDelayMs ?? 1000, terminalOutputLineLimit: terminalOutputLineLimit ?? 500, terminalShellIntegrationTimeout: terminalShellIntegrationTimeout ?? TERMINAL_SHELL_INTEGRATION_TIMEOUT, + terminalCommandDelay: terminalCommandDelay ?? 0, + terminalPowershellCounter: terminalPowershellCounter ?? false, + terminalZshClearEolMark: terminalZshClearEolMark ?? true, + terminalZshOhMy: terminalZshOhMy ?? false, + terminalZshP10k: terminalZshP10k ?? false, + terminalZdotdir: terminalZdotdir ?? false, fuzzyMatchThreshold: fuzzyMatchThreshold ?? 1.0, mcpEnabled: mcpEnabled ?? true, enableMcpServerCreation: enableMcpServerCreation ?? true, @@ -1350,6 +1381,12 @@ export class ClineProvider extends EventEmitter implements terminalOutputLineLimit: stateValues.terminalOutputLineLimit ?? 500, terminalShellIntegrationTimeout: stateValues.terminalShellIntegrationTimeout ?? TERMINAL_SHELL_INTEGRATION_TIMEOUT, + terminalCommandDelay: stateValues.terminalCommandDelay ?? 0, + terminalPowershellCounter: stateValues.terminalPowershellCounter ?? false, + terminalZshClearEolMark: stateValues.terminalZshClearEolMark ?? true, + terminalZshOhMy: stateValues.terminalZshOhMy ?? false, + terminalZshP10k: stateValues.terminalZshP10k ?? false, + terminalZdotdir: stateValues.terminalZdotdir ?? false, mode: stateValues.mode ?? defaultModeSlug, language: stateValues.language ?? formatLanguage(vscode.env.language), mcpEnabled: stateValues.mcpEnabled ?? true, diff --git a/src/core/webview/webviewMessageHandler.ts b/src/core/webview/webviewMessageHandler.ts index 281db62b3fe..ac78088f4c1 100644 --- a/src/core/webview/webviewMessageHandler.ts +++ b/src/core/webview/webviewMessageHandler.ts @@ -736,6 +736,48 @@ 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 "terminalPowershellCounter": + await updateGlobalState("terminalPowershellCounter", message.bool) + await provider.postStateToWebview() + if (message.bool !== undefined) { + Terminal.setPowershellCounter(message.bool) + } + break + case "terminalZshClearEolMark": + await updateGlobalState("terminalZshClearEolMark", message.bool) + await provider.postStateToWebview() + if (message.bool !== undefined) { + Terminal.setTerminalZshClearEolMark(message.bool) + } + break + case "terminalZshOhMy": + await updateGlobalState("terminalZshOhMy", message.bool) + await provider.postStateToWebview() + if (message.bool !== undefined) { + Terminal.setTerminalZshOhMy(message.bool) + } + break + case "terminalZshP10k": + await updateGlobalState("terminalZshP10k", message.bool) + await provider.postStateToWebview() + if (message.bool !== undefined) { + Terminal.setTerminalZshP10k(message.bool) + } + break + case "terminalZdotdir": + await updateGlobalState("terminalZdotdir", message.bool) + await provider.postStateToWebview() + if (message.bool !== undefined) { + Terminal.setTerminalZdotdir(message.bool) + } + break case "mode": await provider.handleModeSwitch(message.text as Mode) break diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index 0efc708928c..8e7615f33f3 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -266,6 +266,12 @@ type GlobalSettings = { maxReadFileLine?: number | undefined terminalOutputLineLimit?: number | undefined terminalShellIntegrationTimeout?: number | undefined + terminalCommandDelay?: number | undefined + terminalPowershellCounter?: boolean | undefined + terminalZshClearEolMark?: boolean | undefined + terminalZshOhMy?: boolean | undefined + terminalZshP10k?: boolean | undefined + terminalZdotdir?: boolean | undefined rateLimitSeconds?: number | undefined diffEnabled?: boolean | undefined fuzzyMatchThreshold?: number | undefined diff --git a/src/exports/types.ts b/src/exports/types.ts index f61be2e04f9..d75c9818b90 100644 --- a/src/exports/types.ts +++ b/src/exports/types.ts @@ -269,6 +269,12 @@ type GlobalSettings = { maxReadFileLine?: number | undefined terminalOutputLineLimit?: number | undefined terminalShellIntegrationTimeout?: number | undefined + terminalCommandDelay?: number | undefined + terminalPowershellCounter?: boolean | undefined + terminalZshClearEolMark?: boolean | undefined + terminalZshOhMy?: boolean | undefined + terminalZshP10k?: boolean | undefined + terminalZdotdir?: boolean | undefined rateLimitSeconds?: number | undefined diffEnabled?: boolean | undefined fuzzyMatchThreshold?: number | undefined diff --git a/src/integrations/terminal/Terminal.ts b/src/integrations/terminal/Terminal.ts index 340c3427d11..e17d01fa48f 100644 --- a/src/integrations/terminal/Terminal.ts +++ b/src/integrations/terminal/Terminal.ts @@ -2,11 +2,19 @@ import * as vscode from "vscode" import pWaitFor from "p-wait-for" import { ExitCodeDetails, mergePromise, TerminalProcess, TerminalProcessResultPromise } from "./TerminalProcess" import { truncateOutput, applyRunLengthEncoding } from "../misc/extract-text" +// Import TerminalRegistry here to avoid circular dependencies +const { TerminalRegistry } = require("./TerminalRegistry") export const TERMINAL_SHELL_INTEGRATION_TIMEOUT = 5000 export class Terminal { private static shellIntegrationTimeout: number = TERMINAL_SHELL_INTEGRATION_TIMEOUT + private static commandDelay: number = 0 + private static powershellCounter: boolean = false + private static terminalZshClearEolMark: boolean = true + private static terminalZshOhMy: boolean = false + private static terminalZshP10k: boolean = false + private static terminalZdotdir: boolean = false public terminal: vscode.Terminal public busy: boolean @@ -180,10 +188,16 @@ export class Terminal { // Wait for shell integration before executing the command pWaitFor(() => this.terminal.shellIntegration !== undefined, { timeout: Terminal.shellIntegrationTimeout }) .then(() => { + // Clean up temporary directory if shell integration is available, zsh did its job: + TerminalRegistry.zshCleanupTmpDir(this.id) + + // Run the command in the terminal process.run(command) }) .catch(() => { console.log(`[Terminal ${this.id}] Shell integration not available. Command execution aborted.`) + // Clean up temporary directory if shell integration is not available + TerminalRegistry.zshCleanupTmpDir(this.id) process.emit( "no_shell_integration", `Shell integration initialization sequence '\\x1b]633;A' was not received within ${Terminal.shellIntegrationTimeout / 1000}s. Shell integration has been disabled for this terminal instance. Increase the timeout in the settings if necessary.`, @@ -256,7 +270,107 @@ export class Terminal { Terminal.shellIntegrationTimeout = timeoutMs } + public static getShellIntegrationTimeout(): number { + 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 + } + + /** + * Sets whether to use the PowerShell counter workaround + * @param enabled Whether to enable the PowerShell counter workaround + */ + public static setPowershellCounter(enabled: boolean): void { + Terminal.powershellCounter = enabled + } + + /** + * Gets whether to use the PowerShell counter workaround + * @returns Whether the PowerShell counter workaround is enabled + */ + public static getPowershellCounter(): boolean { + return Terminal.powershellCounter + } + + /** + * Sets whether to clear the ZSH EOL mark + * @param enabled Whether to clear the ZSH EOL mark + */ + public static setTerminalZshClearEolMark(enabled: boolean): void { + Terminal.terminalZshClearEolMark = enabled + } + + /** + * Gets whether to clear the ZSH EOL mark + * @returns Whether the ZSH EOL mark clearing is enabled + */ + public static getTerminalZshClearEolMark(): boolean { + return Terminal.terminalZshClearEolMark + } + + /** + * Sets whether to enable Oh My Zsh shell integration + * @param enabled Whether to enable Oh My Zsh shell integration + */ + public static setTerminalZshOhMy(enabled: boolean): void { + Terminal.terminalZshOhMy = enabled + } + + /** + * Gets whether Oh My Zsh shell integration is enabled + * @returns Whether Oh My Zsh shell integration is enabled + */ + public static getTerminalZshOhMy(): boolean { + return Terminal.terminalZshOhMy + } + + /** + * Sets whether to enable Powerlevel10k shell integration + * @param enabled Whether to enable Powerlevel10k shell integration + */ + public static setTerminalZshP10k(enabled: boolean): void { + Terminal.terminalZshP10k = enabled + } + + /** + * Gets whether Powerlevel10k shell integration is enabled + * @returns Whether Powerlevel10k shell integration is enabled + */ + public static getTerminalZshP10k(): boolean { + return Terminal.terminalZshP10k + } + public static compressTerminalOutput(input: string, lineLimit: number): string { return truncateOutput(applyRunLengthEncoding(input), lineLimit) } + + /** + * Sets whether to enable ZDOTDIR handling for zsh + * @param enabled Whether to enable ZDOTDIR handling + */ + public static setTerminalZdotdir(enabled: boolean): void { + Terminal.terminalZdotdir = enabled + } + + /** + * Gets whether ZDOTDIR handling is enabled + * @returns Whether ZDOTDIR handling is enabled + */ + public static getTerminalZdotdir(): boolean { + return Terminal.terminalZdotdir + } } diff --git a/src/integrations/terminal/TerminalProcess.ts b/src/integrations/terminal/TerminalProcess.ts index 21d65577151..a84db00ef30 100644 --- a/src/integrations/terminal/TerminalProcess.ts +++ b/src/integrations/terminal/TerminalProcess.ts @@ -95,7 +95,6 @@ export interface ExitCodeDetails { coreDumpPossible?: boolean } import { Terminal } from "./Terminal" -import { TerminalRegistry } from "./TerminalRegistry" export interface TerminalProcessEvents { line: [line: string] @@ -140,7 +139,10 @@ export class TerminalProcess extends EventEmitter { this.once("no_shell_integration", () => { if (this.terminalInfo) { console.log(`no_shell_integration received for terminal ${this.terminalInfo.id}`) - TerminalRegistry.removeTerminal(this.terminalInfo.id) + this.emit("completed", "") + this.terminalInfo.busy = false + this.terminalInfo.setActiveStream(undefined) + this.continue() } }) } @@ -254,12 +256,16 @@ export class TerminalProcess extends EventEmitter { // Emit no_shell_integration event with descriptive message this.emit( "no_shell_integration", - "VSCE shell integration stream did not start within 3 seconds. Terminal problem?", + `VSCE shell integration stream did not start within ${Terminal.getShellIntegrationTimeout() / 1000} seconds. Terminal problem?`, ) // Reject with descriptive error - reject(new Error("VSCE shell integration stream did not start within 3 seconds.")) - }, 3000) + reject( + new Error( + `VSCE shell integration stream did not start within ${Terminal.getShellIntegrationTimeout() / 1000} seconds.`, + ), + ) + }, Terminal.getShellIntegrationTimeout()) // Clean up timeout if stream becomes available this.once("stream_available", (stream: AsyncIterable) => { @@ -284,9 +290,19 @@ export class TerminalProcess extends EventEmitter { (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 + + // Only add the PowerShell counter workaround if enabled + if (Terminal.getPowershellCounter()) { + commandToExecute += ` ; "(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) } diff --git a/src/integrations/terminal/TerminalRegistry.ts b/src/integrations/terminal/TerminalRegistry.ts index dcf1af76d4d..e136078de9b 100644 --- a/src/integrations/terminal/TerminalRegistry.ts +++ b/src/integrations/terminal/TerminalRegistry.ts @@ -1,4 +1,5 @@ import * as vscode from "vscode" +import * as path from "path" import { arePathsEqual } from "../../utils/path" import { Terminal } from "./Terminal" import { TerminalProcess } from "./TerminalProcess" @@ -9,6 +10,7 @@ export class TerminalRegistry { private static terminals: Terminal[] = [] private static nextTerminalId = 1 private static disposables: vscode.Disposable[] = [] + private static terminalTmpDirs: Map = new Map() private static isInitialized = false static initialize() { @@ -17,6 +19,18 @@ export class TerminalRegistry { } this.isInitialized = true + // Register handler for terminal close events to clean up temporary directories + const closeDisposable = vscode.window.onDidCloseTerminal((terminal) => { + const terminalInfo = this.getTerminalByVSCETerminal(terminal) + if (terminalInfo) { + // Clean up temporary directory if it exists + if (this.terminalTmpDirs.has(terminalInfo.id)) { + this.zshCleanupTmpDir(terminalInfo.id) + } + } + }) + this.disposables.push(closeDisposable) + try { // onDidStartTerminalShellExecution const startDisposable = vscode.window.onDidStartTerminalShellExecution?.( @@ -109,27 +123,60 @@ export class TerminalRegistry { } static createTerminal(cwd: string | vscode.Uri): Terminal { + const env: Record = { + 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", + } + + // Set Oh My Zsh shell integration if enabled + if (Terminal.getTerminalZshOhMy()) { + env.ITERM_SHELL_INTEGRATION_INSTALLED = "Yes" + } + + // Set Powerlevel10k shell integration if enabled + if (Terminal.getTerminalZshP10k()) { + env.POWERLEVEL9K_TERM_SHELL_INTEGRATION = "true" + } + + // 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}` + } + + // Clear the ZSH EOL mark to prevent issues with command output interpretation + // when output ends with special characters like '%' + if (Terminal.getTerminalZshClearEolMark()) { + env.PROMPT_EOL_MARK = "" + } + + // Handle ZDOTDIR for zsh if enabled + if (Terminal.getTerminalZdotdir()) { + env.ZDOTDIR = this.zshInitTmpDir(env) + } + 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() const newTerminal = new Terminal(this.nextTerminalId++, terminal, cwdString) + if (Terminal.getTerminalZdotdir()) { + this.terminalTmpDirs.set(newTerminal.id, env.ZDOTDIR) + console.info( + `[TerminalRegistry] Stored temporary directory path for terminal ${newTerminal.id}: ${env.ZDOTDIR}`, + ) + } + this.terminals.push(newTerminal) return newTerminal } @@ -170,6 +217,8 @@ export class TerminalRegistry { } static removeTerminal(id: number) { + this.zshCleanupTmpDir(id) + this.terminals = this.terminals.filter((t) => t.id !== id) } @@ -258,10 +307,156 @@ export class TerminalRegistry { } static cleanup() { + // Clean up all temporary directories + this.terminalTmpDirs.forEach((_, terminalId) => { + this.zshCleanupTmpDir(terminalId) + }) + this.terminalTmpDirs.clear() + this.disposables.forEach((disposable) => disposable.dispose()) this.disposables = [] } + /** + * Gets the path to the shell integration script for a given shell type + * @param shell The shell type + * @returns The path to the shell integration script + */ + private static getShellIntegrationPath(shell: "bash" | "pwsh" | "zsh" | "fish"): string { + let filename: string + + switch (shell) { + case "bash": + filename = "shellIntegration-bash.sh" + break + case "pwsh": + filename = "shellIntegration.ps1" + break + case "zsh": + filename = "shellIntegration-rc.zsh" + break + case "fish": + filename = "shellIntegration.fish" + break + default: + throw new Error(`Invalid shell type: ${shell}`) + } + + // This is the same path used by the CLI command + return path.join( + vscode.env.appRoot, + "out", + "vs", + "workbench", + "contrib", + "terminal", + "common", + "scripts", + filename, + ) + } + + /** + * Initialize a temporary directory for ZDOTDIR + * @param env The environment variables object to modify + * @returns The path to the temporary directory + */ + private static zshInitTmpDir(env: Record): string { + // Create a temporary directory with the sticky bit set for security + const os = require("os") + const path = require("path") + const tmpDir = path.join(os.tmpdir(), `roo-zdotdir-${Math.random().toString(36).substring(2, 15)}`) + console.info(`[TerminalRegistry] Creating temporary directory for ZDOTDIR: ${tmpDir}`) + + // Save original ZDOTDIR as ROO_ZDOTDIR + if (process.env.ZDOTDIR) { + env.ROO_ZDOTDIR = process.env.ZDOTDIR + } + + // Create the temporary directory + vscode.workspace.fs + .createDirectory(vscode.Uri.file(tmpDir)) + .then(() => { + console.info(`[TerminalRegistry] Created temporary directory for ZDOTDIR at ${tmpDir}`) + + // Create .zshrc in the temporary directory + const zshrcPath = `${tmpDir}/.zshrc` + + // Get the path to the shell integration script + const shellIntegrationPath = this.getShellIntegrationPath("zsh") + + const zshrcContent = ` +source "${shellIntegrationPath}" +ZDOTDIR=\${ROO_ZDOTDIR:-$HOME} +unset ROO_ZDOTDIR +[ -f "$ZDOTDIR/.zshenv" ] && source "$ZDOTDIR/.zshenv" +[ -f "$ZDOTDIR/.zprofile" ] && source "$ZDOTDIR/.zprofile" +[ -f "$ZDOTDIR/.zshrc" ] && source "$ZDOTDIR/.zshrc" +[ -f "$ZDOTDIR/.zlogin" ] && source "$ZDOTDIR/.zlogin" +[ "$ZDOTDIR" = "$HOME" ] && unset ZDOTDIR +` + console.info(`[TerminalRegistry] Creating .zshrc file at ${zshrcPath} with content:\n${zshrcContent}`) + vscode.workspace.fs.writeFile(vscode.Uri.file(zshrcPath), Buffer.from(zshrcContent)).then( + // Success handler + () => { + console.info(`[TerminalRegistry] Successfully created .zshrc file at ${zshrcPath}`) + }, + // Error handler + (error: Error) => { + console.error(`[TerminalRegistry] Error creating .zshrc file at ${zshrcPath}: ${error}`) + }, + ) + }) + .then(undefined, (error: Error) => { + console.error(`[TerminalRegistry] Error creating temporary directory at ${tmpDir}: ${error}`) + }) + + return tmpDir + } + + /** + * Clean up a temporary directory used for ZDOTDIR + */ + private static zshCleanupTmpDir(terminalId: number): boolean { + const tmpDir = this.terminalTmpDirs.get(terminalId) + if (!tmpDir) { + return false + } + + const logPrefix = `[TerminalRegistry] Cleaning up temporary directory for terminal ${terminalId}` + console.info(`${logPrefix}: ${tmpDir}`) + + try { + // Use fs to remove the directory and its contents + const fs = require("fs") + const path = require("path") + + // Remove .zshrc file + const zshrcPath = path.join(tmpDir, ".zshrc") + if (fs.existsSync(zshrcPath)) { + console.info(`${logPrefix}: Removing .zshrc file at ${zshrcPath}`) + fs.unlinkSync(zshrcPath) + } + + // Remove the directory + if (fs.existsSync(tmpDir)) { + console.info(`${logPrefix}: Removing directory at ${tmpDir}`) + fs.rmdirSync(tmpDir) + } + + // Remove it from the map + this.terminalTmpDirs.delete(terminalId) + console.info(`${logPrefix}: Removed terminal ${terminalId} from temporary directory map`) + + return true + } catch (error: unknown) { + console.error( + `[TerminalRegistry] Error cleaning up temporary directory ${tmpDir}: ${error instanceof Error ? error.message : String(error)}`, + ) + return false + } + } + /** * Releases all terminals associated with a task * @param taskId The task ID diff --git a/src/integrations/terminal/__tests__/TerminalProcessExec.bash.test.ts b/src/integrations/terminal/__tests__/TerminalProcessExec.bash.test.ts index ace4ee2ec1b..109203c5991 100644 --- a/src/integrations/terminal/__tests__/TerminalProcessExec.bash.test.ts +++ b/src/integrations/terminal/__tests__/TerminalProcessExec.bash.test.ts @@ -11,6 +11,7 @@ jest.mock("vscode", () => { const eventHandlers = { startTerminalShellExecution: null, endTerminalShellExecution: null, + closeTerminal: null, } return { @@ -29,6 +30,10 @@ jest.mock("vscode", () => { eventHandlers.endTerminalShellExecution = handler return { dispose: jest.fn() } }), + onDidCloseTerminal: jest.fn().mockImplementation((handler) => { + eventHandlers.closeTerminal = handler + return { dispose: jest.fn() } + }), }, ThemeIcon: class ThemeIcon { constructor(id: string) { diff --git a/src/integrations/terminal/__tests__/TerminalProcessExec.cmd.test.ts b/src/integrations/terminal/__tests__/TerminalProcessExec.cmd.test.ts index c8be116b9f8..80d57da6176 100644 --- a/src/integrations/terminal/__tests__/TerminalProcessExec.cmd.test.ts +++ b/src/integrations/terminal/__tests__/TerminalProcessExec.cmd.test.ts @@ -16,6 +16,7 @@ jest.mock("vscode", () => { const eventHandlers = { startTerminalShellExecution: null, endTerminalShellExecution: null, + closeTerminal: null, } return { @@ -34,6 +35,10 @@ jest.mock("vscode", () => { eventHandlers.endTerminalShellExecution = handler return { dispose: jest.fn() } }), + onDidCloseTerminal: jest.fn().mockImplementation((handler) => { + eventHandlers.closeTerminal = handler + return { dispose: jest.fn() } + }), }, ThemeIcon: class ThemeIcon { constructor(id: string) { diff --git a/src/integrations/terminal/__tests__/TerminalProcessExec.pwsh.test.ts b/src/integrations/terminal/__tests__/TerminalProcessExec.pwsh.test.ts index 01c5b8d7fbd..3294d1198ee 100644 --- a/src/integrations/terminal/__tests__/TerminalProcessExec.pwsh.test.ts +++ b/src/integrations/terminal/__tests__/TerminalProcessExec.pwsh.test.ts @@ -17,6 +17,7 @@ jest.mock("vscode", () => { const eventHandlers = { startTerminalShellExecution: null, endTerminalShellExecution: null, + closeTerminal: null, } return { @@ -35,6 +36,10 @@ jest.mock("vscode", () => { eventHandlers.endTerminalShellExecution = handler return { dispose: jest.fn() } }), + onDidCloseTerminal: jest.fn().mockImplementation((handler) => { + eventHandlers.closeTerminal = handler + return { dispose: jest.fn() } + }), }, ThemeIcon: class ThemeIcon { constructor(id: string) { diff --git a/src/integrations/terminal/__tests__/TerminalRegistry.test.ts b/src/integrations/terminal/__tests__/TerminalRegistry.test.ts index a2b8fcd3b08..e813b9ba466 100644 --- a/src/integrations/terminal/__tests__/TerminalRegistry.test.ts +++ b/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 @@ -12,6 +13,7 @@ jest.mock("vscode", () => ({ exitStatus: undefined, } }, + onDidCloseTerminal: jest.fn().mockReturnValue({ dispose: jest.fn() }), }, ThemeIcon: jest.fn(), })) @@ -31,10 +33,77 @@ describe("TerminalRegistry", () => { iconPath: expect.any(Object), env: { PAGER: "cat", - PROMPT_COMMAND: "sleep 0.050", VTE_VERSION: "0", + PROMPT_EOL_MARK: "", }, }) }) + + 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", + PROMPT_EOL_MARK: "", + }, + }) + } finally { + // Restore original delay + Terminal.setCommandDelay(originalDelay) + } + }) + + it("adds Oh My Zsh integration env var when enabled", () => { + Terminal.setTerminalZshOhMy(true) + try { + TerminalRegistry.createTerminal("/test/path") + + expect(mockCreateTerminal).toHaveBeenCalledWith({ + cwd: "/test/path", + name: "Roo Code", + iconPath: expect.any(Object), + env: { + PAGER: "cat", + VTE_VERSION: "0", + PROMPT_EOL_MARK: "", + ITERM_SHELL_INTEGRATION_INSTALLED: "Yes", + }, + }) + } finally { + Terminal.setTerminalZshOhMy(false) + } + }) + + it("adds Powerlevel10k integration env var when enabled", () => { + Terminal.setTerminalZshP10k(true) + try { + TerminalRegistry.createTerminal("/test/path") + + expect(mockCreateTerminal).toHaveBeenCalledWith({ + cwd: "/test/path", + name: "Roo Code", + iconPath: expect.any(Object), + env: { + PAGER: "cat", + VTE_VERSION: "0", + PROMPT_EOL_MARK: "", + POWERLEVEL9K_TERM_SHELL_INTEGRATION: "true", + }, + }) + } finally { + Terminal.setTerminalZshP10k(false) + } + }) }) }) diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 637aaeabe52..8bd04f82282 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -532,6 +532,12 @@ export const globalSettingsSchema = z.object({ terminalOutputLineLimit: z.number().optional(), terminalShellIntegrationTimeout: z.number().optional(), + terminalCommandDelay: z.number().optional(), + terminalPowershellCounter: z.boolean().optional(), + terminalZshClearEolMark: z.boolean().optional(), + terminalZshOhMy: z.boolean().optional(), + terminalZshP10k: z.boolean().optional(), + terminalZdotdir: z.boolean().optional(), rateLimitSeconds: z.number().optional(), diffEnabled: z.boolean().optional(), @@ -602,6 +608,12 @@ const globalSettingsRecord: GlobalSettingsRecord = { terminalOutputLineLimit: undefined, terminalShellIntegrationTimeout: undefined, + terminalCommandDelay: undefined, + terminalPowershellCounter: undefined, + terminalZshClearEolMark: undefined, + terminalZshOhMy: undefined, + terminalZshP10k: undefined, + terminalZdotdir: undefined, rateLimitSeconds: undefined, diffEnabled: undefined, diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 38277a7c2de..4fd8ccf2884 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -153,6 +153,12 @@ export type ExtensionState = Pick< // | "maxReadFileLine" // Optional in GlobalSettings, required here. | "terminalOutputLineLimit" | "terminalShellIntegrationTimeout" + | "terminalCommandDelay" + | "terminalPowershellCounter" + | "terminalZshClearEolMark" + | "terminalZshOhMy" + | "terminalZshP10k" + | "terminalZdotdir" | "diffEnabled" | "fuzzyMatchThreshold" // | "experiments" // Optional in GlobalSettings, required here. diff --git a/src/shared/WebviewMessage.ts b/src/shared/WebviewMessage.ts index 972845959e3..93b69447397 100644 --- a/src/shared/WebviewMessage.ts +++ b/src/shared/WebviewMessage.ts @@ -82,6 +82,12 @@ export interface WebviewMessage { | "deleteMessage" | "terminalOutputLineLimit" | "terminalShellIntegrationTimeout" + | "terminalCommandDelay" + | "terminalPowershellCounter" + | "terminalZshClearEolMark" + | "terminalZshOhMy" + | "terminalZshP10k" + | "terminalZdotdir" | "mcpEnabled" | "enableMcpServerCreation" | "searchCommits" diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index aaa9f93e782..05005e46a1a 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -963,10 +963,16 @@ export const ChatRowContent = ({
{message.text}
+
+ • {t("chat:shellIntegration.checkSettings")} +
+ • {t("chat:shellIntegration.updateVSCode")} ( + CMD/CTRL + Shift + P → "Update") +
+ • {t("chat:shellIntegration.supportedShell")} ( + CMD/CTRL + Shift + P → "Terminal: Select Default Profile") +

- Please update VSCode (CMD/CTRL + Shift + P → "Update") and make sure - you're using a supported shell: zsh, bash, fish, or PowerShell ( - CMD/CTRL + Shift + P → "Terminal: Select Default Profile").{" "} diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index 2411067d778..c8b24e0dcd5 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -129,6 +129,12 @@ const SettingsView = forwardRef(({ onDone, t telemetrySetting, terminalOutputLineLimit, terminalShellIntegrationTimeout, + terminalCommandDelay, + terminalPowershellCounter, + terminalZshClearEolMark, + terminalZshOhMy, + terminalZshP10k, + terminalZdotdir, writeDelayMs, showRooIgnoredFiles, remoteBrowserEnabled, @@ -237,6 +243,12 @@ const SettingsView = forwardRef(({ 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: "terminalPowershellCounter", bool: terminalPowershellCounter }) + vscode.postMessage({ type: "terminalZshClearEolMark", bool: terminalZshClearEolMark }) + vscode.postMessage({ type: "terminalZshOhMy", bool: terminalZshOhMy }) + vscode.postMessage({ type: "terminalZshP10k", bool: terminalZshP10k }) + vscode.postMessage({ type: "terminalZdotdir", bool: terminalZdotdir }) vscode.postMessage({ type: "mcpEnabled", bool: mcpEnabled }) vscode.postMessage({ type: "alwaysApproveResubmit", bool: alwaysApproveResubmit }) vscode.postMessage({ type: "requestDelaySeconds", value: requestDelaySeconds }) @@ -481,6 +493,12 @@ const SettingsView = forwardRef(({ onDone, t
diff --git a/webview-ui/src/components/settings/TerminalSettings.tsx b/webview-ui/src/components/settings/TerminalSettings.tsx index 27e4a5b5876..d4e2d8850d5 100644 --- a/webview-ui/src/components/settings/TerminalSettings.tsx +++ b/webview-ui/src/components/settings/TerminalSettings.tsx @@ -1,6 +1,7 @@ import { HTMLAttributes } from "react" import { useAppTranslation } from "@/i18n/TranslationContext" import { SquareTerminal } from "lucide-react" +import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" import { cn } from "@/lib/utils" import { Slider } from "@/components/ui" @@ -12,12 +13,33 @@ import { Section } from "./Section" type TerminalSettingsProps = HTMLAttributes & { terminalOutputLineLimit?: number terminalShellIntegrationTimeout?: number - setCachedStateField: SetCachedStateField<"terminalOutputLineLimit" | "terminalShellIntegrationTimeout"> + terminalCommandDelay?: number + terminalPowershellCounter?: boolean + terminalZshClearEolMark?: boolean + terminalZshOhMy?: boolean + terminalZshP10k?: boolean + terminalZdotdir?: boolean + setCachedStateField: SetCachedStateField< + | "terminalOutputLineLimit" + | "terminalShellIntegrationTimeout" + | "terminalCommandDelay" + | "terminalPowershellCounter" + | "terminalZshClearEolMark" + | "terminalZshOhMy" + | "terminalZshP10k" + | "terminalZdotdir" + > } export const TerminalSettings = ({ terminalOutputLineLimit, terminalShellIntegrationTimeout, + terminalCommandDelay, + terminalPowershellCounter, + terminalZshClearEolMark, + terminalZshOhMy, + terminalZshP10k, + terminalZdotdir, setCachedStateField, className, ...props @@ -75,6 +97,85 @@ export const TerminalSettings = ({ {t("settings:terminal.shellIntegrationTimeout.description")} + +
+ +
+ + setCachedStateField("terminalCommandDelay", Math.min(1000, Math.max(0, value))) + } + /> + {terminalCommandDelay ?? 50}ms +
+
+ {t("settings:terminal.commandDelay.description")} +
+
+ +
+ setCachedStateField("terminalPowershellCounter", e.target.checked)} + data-testid="terminal-powershell-counter-checkbox"> + {t("settings:terminal.powershellCounter.label")} + +
+ {t("settings:terminal.powershellCounter.description")} +
+
+ +
+ setCachedStateField("terminalZshClearEolMark", e.target.checked)} + data-testid="terminal-zsh-clear-eol-mark-checkbox"> + {t("settings:terminal.zshClearEolMark.label")} + +
+ {t("settings:terminal.zshClearEolMark.description")} +
+
+ +
+ setCachedStateField("terminalZshOhMy", e.target.checked)} + data-testid="terminal-zsh-oh-my-checkbox"> + {t("settings:terminal.zshOhMy.label")} + +
+ {t("settings:terminal.zshOhMy.description")} +
+
+ +
+ setCachedStateField("terminalZshP10k", e.target.checked)} + data-testid="terminal-zsh-p10k-checkbox"> + {t("settings:terminal.zshP10k.label")} + +
+ {t("settings:terminal.zshP10k.description")} +
+
+ +
+ setCachedStateField("terminalZdotdir", e.target.checked)} + data-testid="terminal-zdotdir-checkbox"> + {t("settings:terminal.zdotdir.label")} + +
+ {t("settings:terminal.zdotdir.description")} +
+
) diff --git a/webview-ui/src/context/ExtensionStateContext.tsx b/webview-ui/src/context/ExtensionStateContext.tsx index 477c9f9f7c5..4b42a0fa389 100644 --- a/webview-ui/src/context/ExtensionStateContext.tsx +++ b/webview-ui/src/context/ExtensionStateContext.tsx @@ -39,6 +39,8 @@ export interface ExtensionStateContextType extends ExtensionState { setSoundVolume: (value: number) => void terminalShellIntegrationTimeout?: number setTerminalShellIntegrationTimeout: (value: number) => void + terminalZdotdir?: boolean + setTerminalZdotdir: (value: boolean) => void setTtsEnabled: (value: boolean) => void setTtsSpeed: (value: number) => void setDiffEnabled: (value: boolean) => void @@ -158,6 +160,9 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode renderContext: "sidebar", maxReadFileLine: 500, // Default max read file line limit pinnedApiConfigs: {}, // Empty object for pinned API configs + terminalZshOhMy: false, // Default Oh My Zsh integration setting + terminalZshP10k: false, // Default Powerlevel10k integration setting + terminalZdotdir: false, // Default ZDOTDIR handling setting }) const [didHydrateState, setDidHydrateState] = useState(false) @@ -165,7 +170,6 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode const [theme, setTheme] = useState(undefined) const [filePaths, setFilePaths] = useState([]) const [openedTabs, setOpenedTabs] = useState>([]) - const [mcpServers, setMcpServers] = useState([]) const [currentCheckpoint, setCurrentCheckpoint] = useState() @@ -288,6 +292,7 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode setState((prevState) => ({ ...prevState, terminalOutputLineLimit: value })), setTerminalShellIntegrationTimeout: (value) => setState((prevState) => ({ ...prevState, terminalShellIntegrationTimeout: value })), + setTerminalZdotdir: (value) => setState((prevState) => ({ ...prevState, terminalZdotdir: value })), setMcpEnabled: (value) => setState((prevState) => ({ ...prevState, mcpEnabled: value })), setEnableMcpServerCreation: (value) => setState((prevState) => ({ ...prevState, enableMcpServerCreation: value })), diff --git a/webview-ui/src/i18n/locales/ca/chat.json b/webview-ui/src/i18n/locales/ca/chat.json index 6c913965d65..76f195f6373 100644 --- a/webview-ui/src/i18n/locales/ca/chat.json +++ b/webview-ui/src/i18n/locales/ca/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "Tasca completada", "shellIntegration": { "unavailable": "Integració de shell no disponible", - "troubleshooting": "Encara tens problemes?" + "troubleshooting": "Encara tens problemes? Fes clic aquí per a la documentació d'integració de shell.", + "checkSettings": "Comprova les solucions alternatives del terminal a la pàgina de configuració", + "updateVSCode": "Actualitza VSCode", + "supportedShell": "Assegura't d'utilitzar un shell compatible: zsh, bash, fish o PowerShell" }, "powershell": { "issues": "Sembla que estàs tenint problemes amb Windows PowerShell, si us plau consulta aquesta documentació per a més informació." diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index c2b62a25265..390362f099b 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -301,6 +301,30 @@ "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." + }, + "zdotdir": { + "label": "Habilitar gestió de ZDOTDIR", + "description": "Quan està habilitat, crea un directori temporal per a ZDOTDIR per gestionar correctament la integració del shell zsh. Això assegura que la integració del shell de VSCode funcioni correctament amb zsh mentre es preserva la teva configuració de zsh. (experimental)" + }, + "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." + }, + "powershellCounter": { + "label": "Habilita la solució temporal del comptador PowerShell", + "description": "Quan està habilitat, afegeix un comptador a les comandes PowerShell per assegurar l'execució correcta de les comandes. Això ajuda amb els terminals PowerShell que poden tenir problemes amb la captura de sortida." + }, + "zshClearEolMark": { + "label": "Neteja la marca EOL de ZSH", + "description": "Quan està habilitat, neteja la marca de final de línia de ZSH establint PROMPT_EOL_MARK=''. Això evita problemes amb la interpretació de la sortida de comandes quan acaba amb caràcters especials com '%'." + }, + "zshOhMy": { + "label": "Habilita la integració Oh My Zsh", + "description": "Quan està habilitat, estableix ITERM_SHELL_INTEGRATION_INSTALLED=Yes per habilitar les característiques d'integració del shell Oh My Zsh. (experimental)" + }, + "zshP10k": { + "label": "Habilita la integració Powerlevel10k", + "description": "Quan està habilitat, estableix POWERLEVEL9K_TERM_SHELL_INTEGRATION=true per habilitar les característiques d'integració del shell Powerlevel10k. (experimental)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/de/chat.json b/webview-ui/src/i18n/locales/de/chat.json index cb97b0bc842..302cccfe9cd 100644 --- a/webview-ui/src/i18n/locales/de/chat.json +++ b/webview-ui/src/i18n/locales/de/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "Aufgabe abgeschlossen", "shellIntegration": { "unavailable": "Shell-Integration nicht verfügbar", - "troubleshooting": "Immer noch Probleme?" + "troubleshooting": "Immer noch Probleme? Klicke hier für die Shell-Integrationsdokumentation.", + "checkSettings": "Überprüfe die Terminal-Workarounds in den Einstellungen", + "updateVSCode": "VSCode aktualisieren", + "supportedShell": "Stelle sicher, dass du eine unterstützte Shell verwendest: zsh, bash, fish oder PowerShell" }, "powershell": { "issues": "Es scheint, dass du Probleme mit Windows PowerShell hast, bitte sieh dir dies an" diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index 9659d0cda7a..59ea1f6f1ea 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -300,7 +300,31 @@ }, "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." + }, + "zdotdir": { + "label": "ZDOTDIR-Behandlung aktivieren", + "description": "Erstellt bei Aktivierung ein temporäres Verzeichnis für ZDOTDIR, um die zsh-Shell-Integration korrekt zu handhaben. Dies stellt sicher, dass die VSCode-Shell-Integration mit zsh funktioniert und dabei deine zsh-Konfiguration erhalten bleibt. (experimentell)" + }, + "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." + }, + "powershellCounter": { + "label": "PowerShell-Zähler-Workaround aktivieren", + "description": "Wenn aktiviert, fügt einen Zähler zu PowerShell-Befehlen hinzu, um die korrekte Befehlsausführung sicherzustellen. Dies hilft bei PowerShell-Terminals, die Probleme mit der Ausgabeerfassung haben könnten." + }, + "zshClearEolMark": { + "label": "ZSH-Zeilenende-Markierung löschen", + "description": "Wenn aktiviert, wird die ZSH-Zeilenende-Markierung durch Setzen von PROMPT_EOL_MARK='' gelöscht. Dies verhindert Probleme bei der Interpretation der Befehlsausgabe, wenn diese mit Sonderzeichen wie '%' endet." + }, + "zshOhMy": { + "label": "Oh My Zsh-Integration aktivieren", + "description": "Wenn aktiviert, wird ITERM_SHELL_INTEGRATION_INSTALLED=Yes gesetzt, um die Shell-Integrationsfunktionen von Oh My Zsh zu aktivieren. (experimentell)" + }, + "zshP10k": { + "label": "Powerlevel10k-Integration aktivieren", + "description": "Wenn aktiviert, wird POWERLEVEL9K_TERM_SHELL_INTEGRATION=true gesetzt, um die Shell-Integrationsfunktionen von Powerlevel10k zu aktivieren. (experimentell)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/en/chat.json b/webview-ui/src/i18n/locales/en/chat.json index f9f838356d8..efc492b7a6b 100644 --- a/webview-ui/src/i18n/locales/en/chat.json +++ b/webview-ui/src/i18n/locales/en/chat.json @@ -160,7 +160,10 @@ "troubleMessage": "Roo is having trouble...", "shellIntegration": { "unavailable": "Shell Integration Unavailable", - "troubleshooting": "Still having trouble?" + "troubleshooting": "Still having trouble? Click here for shell integration documentation.", + "checkSettings": "Check terminal workarounds in the settings page", + "updateVSCode": "Update VSCode", + "supportedShell": "Make sure you're using a supported shell: zsh, bash, fish, or PowerShell" }, "powershell": { "issues": "It seems like you're having Windows PowerShell issues, please see this" diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 8ec853a60c5..5ba66f34e27 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -301,6 +301,30 @@ "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." + }, + "powershellCounter": { + "label": "Enable PowerShell counter workaround", + "description": "When enabled, adds a counter to PowerShell commands to ensure proper command execution. This helps with PowerShell terminals that might have issues with command output capture." + }, + "zshClearEolMark": { + "label": "Clear ZSH EOL mark", + "description": "When enabled, clears the ZSH end-of-line mark by setting PROMPT_EOL_MARK=''. This prevents issues with command output interpretation when output ends with special characters like '%'." + }, + "zshOhMy": { + "label": "Enable Oh My Zsh integration", + "description": "When enabled, sets ITERM_SHELL_INTEGRATION_INSTALLED=Yes to enable Oh My Zsh shell integration features. (experimental)" + }, + "zshP10k": { + "label": "Enable Powerlevel10k integration", + "description": "When enabled, sets POWERLEVEL9K_TERM_SHELL_INTEGRATION=true to enable Powerlevel10k shell integration features. (experimental)" + }, + "zdotdir": { + "label": "Enable ZDOTDIR handling", + "description": "When enabled, creates a temporary directory for ZDOTDIR to handle zsh shell integration properly. This ensures VSCode shell integration works correctly with zsh while preserving your zsh configuration. (experimental)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/es/chat.json b/webview-ui/src/i18n/locales/es/chat.json index caa1b6048ce..5e86247416a 100644 --- a/webview-ui/src/i18n/locales/es/chat.json +++ b/webview-ui/src/i18n/locales/es/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "Tarea completada", "shellIntegration": { "unavailable": "Integración de shell no disponible", - "troubleshooting": "¿Sigues teniendo problemas?" + "troubleshooting": "¿Sigues teniendo problemas? Haz clic aquí para ver la documentación de integración de shell.", + "checkSettings": "Revisa los ajustes alternativos de terminal en la página de configuración", + "updateVSCode": "Actualiza VSCode", + "supportedShell": "Asegúrate de usar un shell compatible: zsh, bash, fish o PowerShell" }, "powershell": { "issues": "Parece que estás teniendo problemas con Windows PowerShell, por favor consulta esta" diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index e6852a9e8de..256c4d73f3b 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -301,6 +301,30 @@ "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." + }, + "zdotdir": { + "label": "Habilitar gestión de ZDOTDIR", + "description": "Cuando está habilitado, crea un directorio temporal para ZDOTDIR para manejar correctamente la integración del shell zsh. Esto asegura que la integración del shell de VSCode funcione correctamente con zsh mientras preserva tu configuración de zsh. (experimental)" + }, + "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." + }, + "powershellCounter": { + "label": "Habilitar solución temporal del contador de PowerShell", + "description": "Cuando está habilitado, agrega un contador a los comandos de PowerShell para garantizar la ejecución correcta de los comandos. Esto ayuda con las terminales PowerShell que pueden tener problemas con la captura de salida de comandos." + }, + "zshClearEolMark": { + "label": "Limpiar marca de fin de línea de ZSH", + "description": "Cuando está habilitado, limpia la marca de fin de línea de ZSH estableciendo PROMPT_EOL_MARK=''. Esto evita problemas con la interpretación de la salida de comandos cuando termina con caracteres especiales como '%'." + }, + "zshOhMy": { + "label": "Habilitar integración Oh My Zsh", + "description": "Cuando está habilitado, establece ITERM_SHELL_INTEGRATION_INSTALLED=Yes para habilitar las características de integración del shell Oh My Zsh. (experimental)" + }, + "zshP10k": { + "label": "Habilitar integración Powerlevel10k", + "description": "Cuando está habilitado, establece POWERLEVEL9K_TERM_SHELL_INTEGRATION=true para habilitar las características de integración del shell Powerlevel10k. (experimental)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/fr/chat.json b/webview-ui/src/i18n/locales/fr/chat.json index 28254ab1c82..36f8cbe2d4e 100644 --- a/webview-ui/src/i18n/locales/fr/chat.json +++ b/webview-ui/src/i18n/locales/fr/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "Tâche terminée", "shellIntegration": { "unavailable": "Intégration du shell indisponible", - "troubleshooting": "Toujours des problèmes ?" + "troubleshooting": "Toujours des problèmes ? Cliquez ici pour la documentation d'intégration du shell.", + "checkSettings": "Vérifie les solutions de contournement du terminal dans les paramètres", + "updateVSCode": "Mets à jour VSCode", + "supportedShell": "Assure-toi d'utiliser un shell supporté : zsh, bash, fish ou PowerShell" }, "powershell": { "issues": "Il semble que vous rencontriez des problèmes avec Windows PowerShell, veuillez consulter ce" diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index 4b77dfa7671..23d99a057d4 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -301,6 +301,30 @@ "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." + }, + "zdotdir": { + "label": "Activer la gestion ZDOTDIR", + "description": "Lorsque activé, crée un répertoire temporaire pour ZDOTDIR afin de gérer correctement l'intégration du shell zsh. Cela garantit le bon fonctionnement de l'intégration du shell VSCode avec zsh tout en préservant votre configuration zsh. (expérimental)" + }, + "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." + }, + "powershellCounter": { + "label": "Activer le contournement du compteur PowerShell", + "description": "Lorsqu'activé, ajoute un compteur aux commandes PowerShell pour assurer une exécution correcte des commandes. Cela aide avec les terminaux PowerShell qui peuvent avoir des problèmes de capture de sortie." + }, + "zshClearEolMark": { + "label": "Effacer la marque de fin de ligne ZSH", + "description": "Lorsqu'activé, efface la marque de fin de ligne ZSH en définissant PROMPT_EOL_MARK=''. Cela évite les problèmes d'interprétation de la sortie des commandes lorsqu'elle se termine par des caractères spéciaux comme '%'." + }, + "zshOhMy": { + "label": "Activer l'intégration Oh My Zsh", + "description": "Lorsqu'activé, définit ITERM_SHELL_INTEGRATION_INSTALLED=Yes pour activer les fonctionnalités d'intégration du shell Oh My Zsh. (expérimental)" + }, + "zshP10k": { + "label": "Activer l'intégration Powerlevel10k", + "description": "Lorsqu'activé, définit POWERLEVEL9K_TERM_SHELL_INTEGRATION=true pour activer les fonctionnalités d'intégration du shell Powerlevel10k. (expérimental)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/hi/chat.json b/webview-ui/src/i18n/locales/hi/chat.json index 78904af0062..9b68943eaeb 100644 --- a/webview-ui/src/i18n/locales/hi/chat.json +++ b/webview-ui/src/i18n/locales/hi/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "कार्य पूरा हुआ", "shellIntegration": { "unavailable": "शेल एकीकरण अनुपलब्ध", - "troubleshooting": "अभी भी समस्या है?" + "troubleshooting": "अभी भी समस्या है? शेल एकीकरण दस्तावेज़ के लिए यहाँ क्लिक करें।", + "checkSettings": "सेटिंग्स पेज में टर्मिनल वर्कअराउंड जांचें", + "updateVSCode": "VSCode अपडेट करें", + "supportedShell": "सुनिश्चित करें कि आप समर्थित शेल का उपयोग कर रहे हैं: zsh, bash, fish या PowerShell" }, "powershell": { "issues": "ऐसा लगता है कि आपको Windows PowerShell के साथ समस्याएँ हो रही हैं, कृपया इसे देखें" diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index d69b1b9b289..59556718c11 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -301,6 +301,30 @@ "shellIntegrationTimeout": { "label": "टर्मिनल शेल एकीकरण टाइमआउट", "description": "कमांड निष्पादित करने से पहले शेल एकीकरण के आरंभ होने के लिए प्रतीक्षा का अधिकतम समय। लंबे शेल स्टार्टअप समय वाले उपयोगकर्ताओं के लिए, यदि आप टर्मिनल में \"Shell Integration Unavailable\" त्रुटियाँ देखते हैं तो इस मान को बढ़ाने की आवश्यकता हो सकती है।" + }, + "zdotdir": { + "label": "ZDOTDIR प्रबंधन सक्षम करें", + "description": "सक्षम होने पर, zsh शेल एकीकरण को सही ढंग से संभालने के लिए ZDOTDIR के लिए एक अस्थायी डायरेक्टरी बनाता है। यह आपके zsh कॉन्फ़िगरेशन को बनाए रखते हुए VSCode शेल एकीकरण को zsh के साथ सही ढंग से काम करने की सुनिश्चितता करता है। (प्रयोगात्मक)" + }, + "commandDelay": { + "label": "टर्मिनल कमांड विलंब", + "description": "कमांड निष्पादन के बाद जोड़ने के लिए मिलीसेकंड में विलंब। 0 का डिफ़ॉल्ट सेटिंग विलंब को पूरी तरह से अक्षम कर देता है। यह टाइमिंग समस्याओं वाले टर्मिनलों में कमांड आउटपुट को पूरी तरह से कैप्चर करने में मदद कर सकता है। अधिकांश टर्मिनलों में यह `PROMPT_COMMAND='sleep N'` सेट करके कार्यान्वित किया जाता है और Powershell प्रत्येक कमांड के अंत में `start-sleep` जोड़ता है। मूल रूप से यह VSCode बग#237208 के लिए एक समाधान था और इसकी आवश्यकता नहीं हो सकती है।" + }, + "powershellCounter": { + "label": "PowerShell काउंटर समाधान सक्षम करें", + "description": "सक्षम होने पर, कमांड के सही निष्पादन को सुनिश्चित करने के लिए PowerShell कमांड में एक काउंटर जोड़ता है। यह उन PowerShell टर्मिनलों के साथ मदद करता है जिनमें आउटपुट कैप्चर करने में समस्याएं हो सकती हैं।" + }, + "zshClearEolMark": { + "label": "ZSH EOL मार्क साफ़ करें", + "description": "सक्षम होने पर, PROMPT_EOL_MARK='' सेट करके ZSH लाइन-समाप्ति मार्क को साफ़ करता है। यह कमांड आउटपुट की व्याख्या में समस्याओं को रोकता है जब आउटपुट '%' जैसे विशेष वर्णों के साथ समाप्त होता है।" + }, + "zshOhMy": { + "label": "Oh My Zsh एकीकरण सक्षम करें", + "description": "सक्षम होने पर, Oh My Zsh शेल एकीकरण सुविधाओं को सक्षम करने के लिए ITERM_SHELL_INTEGRATION_INSTALLED=Yes सेट करता है। (प्रयोगात्मक)" + }, + "zshP10k": { + "label": "Powerlevel10k एकीकरण सक्षम करें", + "description": "सक्षम होने पर, Powerlevel10k शेल एकीकरण सुविधाओं को सक्षम करने के लिए POWERLEVEL9K_TERM_SHELL_INTEGRATION=true सेट करता है। (प्रयोगात्मक)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/it/chat.json b/webview-ui/src/i18n/locales/it/chat.json index cb1d5f6dc1a..b055c36b863 100644 --- a/webview-ui/src/i18n/locales/it/chat.json +++ b/webview-ui/src/i18n/locales/it/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "Attività completata", "shellIntegration": { "unavailable": "Integrazione shell non disponibile", - "troubleshooting": "Ancora problemi?" + "troubleshooting": "Ancora problemi? Clicca qui per la documentazione sull'integrazione della shell.", + "checkSettings": "Controlla le soluzioni alternative del terminale nella pagina delle impostazioni", + "updateVSCode": "Aggiorna VSCode", + "supportedShell": "Assicurati di utilizzare una shell supportata: zsh, bash, fish o PowerShell" }, "powershell": { "issues": "Sembra che tu stia avendo problemi con Windows PowerShell, consulta questa" diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index 7ce83018ab2..30340b5e29a 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -301,6 +301,30 @@ "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." + }, + "zdotdir": { + "label": "Abilita gestione ZDOTDIR", + "description": "Quando abilitato, crea una directory temporanea per ZDOTDIR per gestire correttamente l'integrazione della shell zsh. Questo assicura che l'integrazione della shell VSCode funzioni correttamente con zsh mantenendo la tua configurazione zsh. (sperimentale)" + }, + "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." + }, + "powershellCounter": { + "label": "Abilita soluzione temporanea contatore PowerShell", + "description": "Quando abilitato, aggiunge un contatore ai comandi PowerShell per garantire la corretta esecuzione dei comandi. Questo aiuta con i terminali PowerShell che potrebbero avere problemi con la cattura dell'output." + }, + "zshClearEolMark": { + "label": "Cancella marcatore fine riga ZSH", + "description": "Quando abilitato, cancella il marcatore di fine riga ZSH impostando PROMPT_EOL_MARK=''. Questo previene problemi con l'interpretazione dell'output dei comandi quando termina con caratteri speciali come '%'." + }, + "zshOhMy": { + "label": "Abilita integrazione Oh My Zsh", + "description": "Quando abilitato, imposta ITERM_SHELL_INTEGRATION_INSTALLED=Yes per abilitare le funzionalità di integrazione della shell Oh My Zsh. (sperimentale)" + }, + "zshP10k": { + "label": "Abilita integrazione Powerlevel10k", + "description": "Quando abilitato, imposta POWERLEVEL9K_TERM_SHELL_INTEGRATION=true per abilitare le funzionalità di integrazione della shell Powerlevel10k. (sperimentale)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/ja/chat.json b/webview-ui/src/i18n/locales/ja/chat.json index 4eb1aa52fe3..74250b70b95 100644 --- a/webview-ui/src/i18n/locales/ja/chat.json +++ b/webview-ui/src/i18n/locales/ja/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "タスク完了", "shellIntegration": { "unavailable": "シェル統合が利用できません", - "troubleshooting": "まだ問題がありますか?" + "troubleshooting": "まだ問題がありますか?シェル統合のドキュメントはこちらをクリックしてください。", + "checkSettings": "設定ページでターミナルの回避策を確認してください", + "updateVSCode": "VSCodeを更新してください", + "supportedShell": "サポートされているシェルを使用していることを確認してください:zsh、bash、fish、またはPowerShell" }, "powershell": { "issues": "Windows PowerShellに問題があるようです。こちらを参照してください" diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index ede80759f19..03e2838d091 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -301,6 +301,30 @@ "shellIntegrationTimeout": { "label": "ターミナルシェル統合タイムアウト", "description": "コマンドを実行する前にシェル統合の初期化を待つ最大時間。シェルの起動時間が長いユーザーの場合、ターミナルで「Shell Integration Unavailable」エラーが表示される場合は、この値を増やす必要があるかもしれません。" + }, + "zdotdir": { + "label": "ZDOTDIR 処理を有効化", + "description": "有効にすると、zsh シェル統合を適切に処理するために ZDOTDIR 用の一時ディレクトリを作成します。これにより、zsh の設定を保持しながら VSCode のシェル統合が正しく機能します。(実験的)" + }, + "commandDelay": { + "label": "ターミナルコマンド遅延", + "description": "コマンド実行後に追加する遅延時間(ミリ秒)。デフォルト設定の0は遅延を完全に無効にします。これはタイミングの問題があるターミナルでコマンド出力を完全にキャプチャするのに役立ちます。ほとんどのターミナルでは`PROMPT_COMMAND='sleep N'`を設定することで実装され、PowerShellは各コマンドの最後に`start-sleep`を追加します。元々はVSCodeバグ#237208の回避策で、必要ない場合があります。" + }, + "powershellCounter": { + "label": "PowerShellカウンター回避策を有効化", + "description": "有効にすると、PowerShellコマンドにカウンターを追加して、コマンドの正しい実行を確保します。これは出力のキャプチャに問題がある可能性のあるPowerShellターミナルで役立ちます。" + }, + "zshClearEolMark": { + "label": "ZSH行末マークをクリア", + "description": "有効にすると、PROMPT_EOL_MARK=''を設定してZSHの行末マークをクリアします。これにより、'%'などの特殊文字で終わるコマンド出力の解釈に関する問題を防ぎます。" + }, + "zshOhMy": { + "label": "Oh My Zsh 統合を有効化", + "description": "有効にすると、ITERM_SHELL_INTEGRATION_INSTALLED=Yes を設定して Oh My Zsh シェル統合機能を有効にします。(実験的)" + }, + "zshP10k": { + "label": "Powerlevel10k 統合を有効化", + "description": "有効にすると、POWERLEVEL9K_TERM_SHELL_INTEGRATION=true を設定して Powerlevel10k シェル統合機能を有効にします。(実験的)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/ko/chat.json b/webview-ui/src/i18n/locales/ko/chat.json index 2f4bff5cd3a..037066f4896 100644 --- a/webview-ui/src/i18n/locales/ko/chat.json +++ b/webview-ui/src/i18n/locales/ko/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "작업 완료", "shellIntegration": { "unavailable": "쉘 통합 사용 불가", - "troubleshooting": "여전히 문제가 있나요?" + "troubleshooting": "여전히 문제가 있나요? 쉘 통합 문서를 보려면 여기를 클릭하세요.", + "checkSettings": "설정 페이지에서 터미널 해결 방법을 확인하세요", + "updateVSCode": "VSCode를 업데이트하세요", + "supportedShell": "지원되는 쉘을 사용하고 있는지 확인하세요: zsh, bash, fish 또는 PowerShell" }, "powershell": { "issues": "Windows PowerShell에 문제가 있는 것 같습니다. 다음을 참조하세요" diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index 05717e06f88..b31df80304e 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -301,6 +301,30 @@ "shellIntegrationTimeout": { "label": "터미널 쉘 통합 타임아웃", "description": "명령을 실행하기 전에 쉘 통합이 초기화될 때까지 기다리는 최대 시간. 쉘 시작 시간이 긴 사용자의 경우, 터미널에서 \"Shell Integration Unavailable\" 오류가 표시되면 이 값을 늘려야 할 수 있습니다." + }, + "zdotdir": { + "label": "ZDOTDIR 처리 활성화", + "description": "활성화하면 zsh 셸 통합을 올바르게 처리하기 위한 ZDOTDIR용 임시 디렉터리를 생성합니다. 이를 통해 zsh 구성을 유지하면서 VSCode 셸 통합이 zsh와 올바르게 작동합니다. (실험적)" + }, + "commandDelay": { + "label": "터미널 명령 지연", + "description": "명령 실행 후 추가할 지연 시간(밀리초). 기본값 0은 지연을 완전히 비활성화합니다. 이는 타이밍 문제가 있는 터미널에서 명령 출력을 완전히 캡처하는 데 도움이 될 수 있습니다. 대부분의 터미널에서는 `PROMPT_COMMAND='sleep N'`을 설정하여 구현되며, PowerShell은 각 명령 끝에 `start-sleep`을 추가합니다. 원래는 VSCode 버그#237208에 대한 해결책이었으며 필요하지 않을 수 있습니다." + }, + "powershellCounter": { + "label": "PowerShell 카운터 해결 방법 활성화", + "description": "활성화하면 PowerShell 명령에 카운터를 추가하여 명령이 올바르게 실행되도록 합니다. 이는 명령 출력 캡처에 문제가 있을 수 있는 PowerShell 터미널에서 도움이 됩니다." + }, + "zshClearEolMark": { + "label": "ZSH 줄 끝 표시 지우기", + "description": "활성화하면 PROMPT_EOL_MARK=''를 설정하여 ZSH 줄 끝 표시를 지웁니다. 이는 '%'와 같은 특수 문자로 끝나는 명령 출력 해석의 문제를 방지합니다." + }, + "zshOhMy": { + "label": "Oh My Zsh 통합 활성화", + "description": "활성화하면 ITERM_SHELL_INTEGRATION_INSTALLED=Yes를 설정하여 Oh My Zsh 셸 통합 기능을 활성화합니다. (실험적)" + }, + "zshP10k": { + "label": "Powerlevel10k 통합 활성화", + "description": "활성화하면 POWERLEVEL9K_TERM_SHELL_INTEGRATION=true를 설정하여 Powerlevel10k 셸 통합 기능을 활성화합니다. (실험적)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/pl/chat.json b/webview-ui/src/i18n/locales/pl/chat.json index 372b3479430..8e6d74669e6 100644 --- a/webview-ui/src/i18n/locales/pl/chat.json +++ b/webview-ui/src/i18n/locales/pl/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "Zadanie zakończone", "shellIntegration": { "unavailable": "Integracja powłoki niedostępna", - "troubleshooting": "Nadal masz problemy?" + "troubleshooting": "Nadal masz problemy? Kliknij tutaj, aby zobaczyć dokumentację integracji powłoki.", + "checkSettings": "Sprawdź obejścia terminala na stronie ustawień", + "updateVSCode": "Zaktualizuj VSCode", + "supportedShell": "Upewnij się, że używasz obsługiwanej powłoki: zsh, bash, fish lub PowerShell" }, "powershell": { "issues": "Wygląda na to, że masz problemy z Windows PowerShell, proszę zapoznaj się z tym" diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index 46c43302a92..7f12e21360a 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -301,6 +301,30 @@ "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." + }, + "zdotdir": { + "label": "Włącz obsługę ZDOTDIR", + "description": "Po włączeniu tworzy tymczasowy katalog dla ZDOTDIR, aby poprawnie obsłużyć integrację powłoki zsh. Zapewnia to prawidłowe działanie integracji powłoki VSCode z zsh, zachowując twoją konfigurację zsh. (eksperymentalne)" + }, + "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." + }, + "powershellCounter": { + "label": "Włącz obejście licznika PowerShell", + "description": "Po włączeniu dodaje licznik do poleceń PowerShell, aby zapewnić prawidłowe wykonanie poleceń. Pomaga to w terminalach PowerShell, które mogą mieć problemy z przechwytywaniem wyjścia." + }, + "zshClearEolMark": { + "label": "Wyczyść znacznik końca linii ZSH", + "description": "Po włączeniu czyści znacznik końca linii ZSH poprzez ustawienie PROMPT_EOL_MARK=''. Zapobiega to problemom z interpretacją wyjścia poleceń, gdy kończy się ono znakami specjalnymi jak '%'." + }, + "zshOhMy": { + "label": "Włącz integrację Oh My Zsh", + "description": "Po włączeniu ustawia ITERM_SHELL_INTEGRATION_INSTALLED=Yes, aby włączyć funkcje integracji powłoki Oh My Zsh. (eksperymentalne)" + }, + "zshP10k": { + "label": "Włącz integrację Powerlevel10k", + "description": "Po włączeniu ustawia POWERLEVEL9K_TERM_SHELL_INTEGRATION=true, aby włączyć funkcje integracji powłoki Powerlevel10k. (eksperymentalne)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/pt-BR/chat.json b/webview-ui/src/i18n/locales/pt-BR/chat.json index d5d7aefc565..bd50af503bf 100644 --- a/webview-ui/src/i18n/locales/pt-BR/chat.json +++ b/webview-ui/src/i18n/locales/pt-BR/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "Tarefa concluída", "shellIntegration": { "unavailable": "Integração de shell indisponível", - "troubleshooting": "Ainda com problemas?" + "troubleshooting": "Ainda com problemas? Clique aqui para ver a documentação de integração do shell.", + "checkSettings": "Verifique as soluções alternativas do terminal na página de configurações", + "updateVSCode": "Atualize o VSCode", + "supportedShell": "Certifique-se de estar usando um shell suportado: zsh, bash, fish ou PowerShell" }, "powershell": { "issues": "Parece que você está tendo problemas com o Windows PowerShell, por favor veja este" diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 139f62dece4..c19a832a57d 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -301,6 +301,30 @@ "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." + }, + "zdotdir": { + "label": "Ativar gerenciamento do ZDOTDIR", + "description": "Quando ativado, cria um diretório temporário para o ZDOTDIR para lidar corretamente com a integração do shell zsh. Isso garante que a integração do shell do VSCode funcione corretamente com o zsh enquanto preserva sua configuração do zsh. (experimental)" + }, + "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." + }, + "powershellCounter": { + "label": "Ativar solução alternativa do contador PowerShell", + "description": "Quando ativado, adiciona um contador aos comandos PowerShell para garantir a execução correta dos comandos. Isso ajuda com terminais PowerShell que podem ter problemas com a captura de saída." + }, + "zshClearEolMark": { + "label": "Limpar marca de fim de linha do ZSH", + "description": "Quando ativado, limpa a marca de fim de linha do ZSH definindo PROMPT_EOL_MARK=''. Isso evita problemas com a interpretação da saída de comandos quando termina com caracteres especiais como '%'." + }, + "zshOhMy": { + "label": "Ativar integração Oh My Zsh", + "description": "Quando ativado, define ITERM_SHELL_INTEGRATION_INSTALLED=Yes para habilitar os recursos de integração do shell Oh My Zsh. (experimental)" + }, + "zshP10k": { + "label": "Ativar integração Powerlevel10k", + "description": "Quando ativado, define POWERLEVEL9K_TERM_SHELL_INTEGRATION=true para habilitar os recursos de integração do shell Powerlevel10k. (experimental)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/tr/chat.json b/webview-ui/src/i18n/locales/tr/chat.json index 3e4d68d6183..baacb7e1d2a 100644 --- a/webview-ui/src/i18n/locales/tr/chat.json +++ b/webview-ui/src/i18n/locales/tr/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "Görev Tamamlandı", "shellIntegration": { "unavailable": "Kabuk Entegrasyonu Kullanılamıyor", - "troubleshooting": "Hala sorun mu yaşıyorsunuz?" + "troubleshooting": "Hala sorun mu yaşıyorsunuz? Kabuk entegrasyonu belgelerine göz atmak için buraya tıklayın.", + "checkSettings": "Ayarlar sayfasındaki terminal geçici çözümlerini kontrol et", + "updateVSCode": "VSCode'u güncelle", + "supportedShell": "Desteklenen bir kabuk kullandığından emin ol: zsh, bash, fish veya PowerShell" }, "powershell": { "issues": "Windows PowerShell ile ilgili sorunlar yaşıyor gibi görünüyorsunuz, lütfen şu konuya bakın" diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index 01c79fa8aaf..9ad9fedc880 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -301,6 +301,30 @@ "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." + }, + "zdotdir": { + "label": "ZDOTDIR işlemeyi etkinleştir", + "description": "Etkinleştirildiğinde, zsh kabuğu entegrasyonunu düzgün şekilde işlemek için ZDOTDIR için geçici bir dizin oluşturur. Bu, zsh yapılandırmanızı korurken VSCode kabuk entegrasyonunun zsh ile düzgün çalışmasını sağlar. (deneysel)" + }, + "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." + }, + "powershellCounter": { + "label": "PowerShell sayaç geçici çözümünü etkinleştir", + "description": "Etkinleştirildiğinde, komutların doğru şekilde yürütülmesini sağlamak için PowerShell komutlarına bir sayaç ekler. Bu, çıktı yakalama sorunları yaşayabilecek PowerShell terminallerinde yardımcı olur." + }, + "zshClearEolMark": { + "label": "ZSH satır sonu işaretini temizle", + "description": "Etkinleştirildiğinde, PROMPT_EOL_MARK='' ayarlanarak ZSH satır sonu işaretini temizler. Bu, '%' gibi özel karakterlerle biten komut çıktılarının yorumlanmasında sorun yaşanmasını önler." + }, + "zshOhMy": { + "label": "Oh My Zsh entegrasyonunu etkinleştir", + "description": "Etkinleştirildiğinde, Oh My Zsh kabuk entegrasyon özelliklerini etkinleştirmek için ITERM_SHELL_INTEGRATION_INSTALLED=Yes ayarlar. (deneysel)" + }, + "zshP10k": { + "label": "Powerlevel10k entegrasyonunu etkinleştir", + "description": "Etkinleştirildiğinde, Powerlevel10k kabuk entegrasyon özelliklerini etkinleştirmek için POWERLEVEL9K_TERM_SHELL_INTEGRATION=true ayarlar. (deneysel)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/vi/chat.json b/webview-ui/src/i18n/locales/vi/chat.json index 7c417d54ef0..021c4cd7308 100644 --- a/webview-ui/src/i18n/locales/vi/chat.json +++ b/webview-ui/src/i18n/locales/vi/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "Nhiệm vụ hoàn thành", "shellIntegration": { "unavailable": "Tích hợp shell không khả dụng", - "troubleshooting": "Vẫn gặp vấn đề?" + "troubleshooting": "Vẫn gặp vấn đề? Nhấp vào đây để xem tài liệu tích hợp shell.", + "checkSettings": "Kiểm tra các giải pháp thay thế cho terminal trong trang cài đặt", + "updateVSCode": "Cập nhật VSCode", + "supportedShell": "Đảm bảo bạn đang sử dụng shell được hỗ trợ: zsh, bash, fish hoặc PowerShell" }, "powershell": { "issues": "Có vẻ như bạn đang gặp vấn đề với Windows PowerShell, vui lòng xem" diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index 04b8de8a324..24eb91d4a2e 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -301,6 +301,30 @@ "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." + }, + "zdotdir": { + "label": "Bật xử lý ZDOTDIR", + "description": "Khi được bật, tạo thư mục tạm thời cho ZDOTDIR để xử lý tích hợp shell zsh một cách chính xác. Điều này đảm bảo tích hợp shell VSCode hoạt động chính xác với zsh trong khi vẫn giữ nguyên cấu hình zsh của bạn. (thử nghiệm)" + }, + "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." + }, + "powershellCounter": { + "label": "Bật giải pháp bộ đếm PowerShell", + "description": "Khi được bật, thêm một bộ đếm vào các lệnh PowerShell để đảm bảo thực thi lệnh chính xác. Điều này giúp ích với các terminal PowerShell có thể gặp vấn đề về ghi lại đầu ra." + }, + "zshClearEolMark": { + "label": "Xóa dấu cuối dòng ZSH", + "description": "Khi được bật, xóa dấu cuối dòng ZSH bằng cách đặt PROMPT_EOL_MARK=''. Điều này ngăn chặn các vấn đề về diễn giải đầu ra lệnh khi kết thúc bằng các ký tự đặc biệt như '%'." + }, + "zshOhMy": { + "label": "Bật tích hợp Oh My Zsh", + "description": "Khi được bật, đặt ITERM_SHELL_INTEGRATION_INSTALLED=Yes để kích hoạt các tính năng tích hợp shell của Oh My Zsh. (thử nghiệm)" + }, + "zshP10k": { + "label": "Bật tích hợp Powerlevel10k", + "description": "Khi được bật, đặt POWERLEVEL9K_TERM_SHELL_INTEGRATION=true để kích hoạt các tính năng tích hợp shell của Powerlevel10k. (thử nghiệm)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/zh-CN/chat.json b/webview-ui/src/i18n/locales/zh-CN/chat.json index a8c261642c1..52c15265dd1 100644 --- a/webview-ui/src/i18n/locales/zh-CN/chat.json +++ b/webview-ui/src/i18n/locales/zh-CN/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "任务完成", "shellIntegration": { "unavailable": "Shell集成不可用", - "troubleshooting": "仍有问题吗?" + "troubleshooting": "仍有问题吗?点击此处查看Shell集成文档。", + "checkSettings": "检查设置页面中的终端解决方案", + "updateVSCode": "更新VSCode", + "supportedShell": "确保使用受支持的shell:zsh、bash、fish或PowerShell" }, "powershell": { "issues": "看起来您遇到了Windows PowerShell问题,请参阅此" diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index 3a99b9d790f..fd1919a5c31 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -301,6 +301,30 @@ "shellIntegrationTimeout": { "label": "终端初始化等待时间", "description": "执行命令前等待 Shell 集成初始化的最长时间。对于 Shell 启动时间较长的用户,如果在终端中看到\"Shell Integration Unavailable\"错误,可能需要增加此值。" + }, + "zdotdir": { + "label": "启用 ZDOTDIR 处理", + "description": "启用后将创建临时目录用于 ZDOTDIR,以正确处理 zsh shell 集成。这确保 VSCode shell 集成能与 zsh 正常工作,同时保留您的 zsh 配置。(实验性)" + }, + "commandDelay": { + "label": "终端命令延迟", + "description": "命令执行后添加的延迟时间(毫秒)。默认设置为 0 时完全禁用延迟。这可以帮助确保在有计时问题的终端中完全捕获命令输出。在大多数终端中,这是通过设置 `PROMPT_COMMAND='sleep N'` 实现的,而 PowerShell 会在每个命令末尾添加 `start-sleep`。最初是为了解决 VSCode 错误#237208,现在可能不再需要。" + }, + "powershellCounter": { + "label": "启用 PowerShell 计数器解决方案", + "description": "启用后,会在 PowerShell 命令中添加计数器以确保命令正确执行。这有助于解决可能存在输出捕获问题的 PowerShell 终端。" + }, + "zshClearEolMark": { + "label": "清除 ZSH 行尾标记", + "description": "启用后,通过设置 PROMPT_EOL_MARK='' 清除 ZSH 行尾标记。这可以防止命令输出以特殊字符(如 '%')结尾时的解析问题。" + }, + "zshOhMy": { + "label": "启用 Oh My Zsh 集成", + "description": "启用后,设置 ITERM_SHELL_INTEGRATION_INSTALLED=Yes 以启用 Oh My Zsh shell 集成功能。(实验性)" + }, + "zshP10k": { + "label": "启用 Powerlevel10k 集成", + "description": "启用后,设置 POWERLEVEL9K_TERM_SHELL_INTEGRATION=true 以启用 Powerlevel10k shell 集成功能。(实验性)" } }, "advanced": { diff --git a/webview-ui/src/i18n/locales/zh-TW/chat.json b/webview-ui/src/i18n/locales/zh-TW/chat.json index b232eea8898..b28ce9e4ee0 100644 --- a/webview-ui/src/i18n/locales/zh-TW/chat.json +++ b/webview-ui/src/i18n/locales/zh-TW/chat.json @@ -160,7 +160,10 @@ "taskCompleted": "工作完成", "shellIntegration": { "unavailable": "Shell 整合功能無法使用", - "troubleshooting": "仍有問題嗎?" + "troubleshooting": "仍有問題嗎?點擊此處查看 Shell 整合文件。", + "checkSettings": "檢查設定頁面中的終端解決方案", + "updateVSCode": "更新 VSCode", + "supportedShell": "確保使用支援的 shell:zsh、bash、fish 或 PowerShell" }, "powershell": { "issues": "看起來您遇到了 Windows PowerShell 的問題,請參考此處" diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index 2e6a3383a43..baa4b614d86 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -301,6 +301,30 @@ "shellIntegrationTimeout": { "label": "終端機 Shell 整合逾時", "description": "執行命令前等待 Shell 整合初始化的最長時間。如果您的 Shell 啟動較慢,且終端機出現「Shell 整合無法使用」的錯誤訊息,可能需要提高此數值。" + }, + "zdotdir": { + "label": "啟用 ZDOTDIR 處理", + "description": "啟用後將建立暫存目錄用於 ZDOTDIR,以正確處理 zsh shell 整合。這確保 VSCode shell 整合能與 zsh 正常運作,同時保留您的 zsh 設定。(實驗性)" + }, + "commandDelay": { + "label": "終端機命令延遲", + "description": "命令執行後添加的延遲時間(毫秒)。預設值為 0 時完全停用延遲。這可以幫助確保在有計時問題的終端機中完整擷取命令輸出。在大多數終端機中,這是透過設定 `PROMPT_COMMAND='sleep N'` 實現的,而 PowerShell 會在每個命令結尾加入 `start-sleep`。最初是為了解決 VSCode 錯誤#237208,現在可能不再需要。" + }, + "powershellCounter": { + "label": "啟用 PowerShell 計數器解決方案", + "description": "啟用後,會在 PowerShell 命令中加入計數器以確保命令正確執行。這有助於解決可能存在輸出擷取問題的 PowerShell 終端機。" + }, + "zshClearEolMark": { + "label": "清除 ZSH 行尾標記", + "description": "啟用後,透過設定 PROMPT_EOL_MARK='' 清除 ZSH 行尾標記。這可以防止命令輸出以特殊字元(如 '%')結尾時的解析問題。" + }, + "zshOhMy": { + "label": "啟用 Oh My Zsh 整合", + "description": "啟用後,設定 ITERM_SHELL_INTEGRATION_INSTALLED=Yes 以啟用 Oh My Zsh shell 整合功能。(實驗性)" + }, + "zshP10k": { + "label": "啟用 Powerlevel10k 整合", + "description": "啟用後,設定 POWERLEVEL9K_TERM_SHELL_INTEGRATION=true 以啟用 Powerlevel10k shell 整合功能。(實驗性)" } }, "advanced": {