Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/tools/executeCommandTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function executeCommandTool(
const {
terminalOutputLineLimit = 500,
terminalOutputCharacterLimit = DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
terminalShellIntegrationDisabled = false,
terminalShellIntegrationDisabled = true,
} = providerState ?? {}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Same default hardcoded here as elsewhere. To avoid future divergence between webview state, provider initialization, and execution path selection (execa vs vscode), consider centralizing the default into a shared constant and importing it here.


// Get command execution timeout from VSCode configuration (in seconds)
Expand Down Expand Up @@ -149,7 +149,7 @@ export async function executeCommand(
executionId,
command,
customCwd,
terminalShellIntegrationDisabled = false,
terminalShellIntegrationDisabled = true,
terminalOutputLineLimit = 500,
terminalOutputCharacterLimit = DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
commandExecutionTimeout = 0,
Expand Down
6 changes: 3 additions & 3 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ export class ClineProvider
this.getState().then(
({
terminalShellIntegrationTimeout = Terminal.defaultShellIntegrationTimeout,
terminalShellIntegrationDisabled = false,
terminalShellIntegrationDisabled = true,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Default duplicated in multiple locations. The default true for terminalShellIntegrationDisabled is set here, in getStateToPostToWebview(), and in executeCommandTool (provider getState destructure and executeCommand param default). This scatters the source of truth and risks drift if one site changes. Consider introducing a single shared constant (e.g., DEFAULT_SHELL_INTEGRATION_DISABLED) in a common module and referencing it in all call sites to keep behavior consistent.

terminalCommandDelay = 0,
terminalZshClearEolMark = true,
terminalZshOhMy = false,
Expand Down Expand Up @@ -1885,7 +1885,7 @@ export class ClineProvider
terminalOutputLineLimit: terminalOutputLineLimit ?? 500,
terminalOutputCharacterLimit: terminalOutputCharacterLimit ?? DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
terminalShellIntegrationTimeout: terminalShellIntegrationTimeout ?? Terminal.defaultShellIntegrationTimeout,
terminalShellIntegrationDisabled: terminalShellIntegrationDisabled ?? false,
terminalShellIntegrationDisabled: terminalShellIntegrationDisabled ?? true,
terminalCommandDelay: terminalCommandDelay ?? 0,
terminalPowershellCounter: terminalPowershellCounter ?? false,
terminalZshClearEolMark: terminalZshClearEolMark ?? true,
Expand Down Expand Up @@ -2106,7 +2106,7 @@ export class ClineProvider
stateValues.terminalOutputCharacterLimit ?? DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
terminalShellIntegrationTimeout:
stateValues.terminalShellIntegrationTimeout ?? Terminal.defaultShellIntegrationTimeout,
terminalShellIntegrationDisabled: stateValues.terminalShellIntegrationDisabled ?? false,
terminalShellIntegrationDisabled: stateValues.terminalShellIntegrationDisabled ?? true,
terminalCommandDelay: stateValues.terminalCommandDelay ?? 0,
terminalPowershellCounter: stateValues.terminalPowershellCounter ?? false,
terminalZshClearEolMark: stateValues.terminalZshClearEolMark ?? true,
Expand Down