VS Code extension: hardcoded 3000ms shell-integration wait causes ~5s delay clicking extension icon

Resolved 💬 4 comments Opened Apr 16, 2026 by s4l4x Closed Apr 20, 2026

Environment

  • macOS 15.x (darwin-arm64), VS Code stable
  • Claude Code extension anthropic.claude-code@2.1.111
  • zsh with working shell integration (OSC 633 markers confirmed, blue gutter decorations visible)
  • Setting claudeCode.useTerminal: true

Repro

  1. Click the Claude Code icon in the VS Code activity bar
  2. A terminal opens
  3. ~5 seconds pass before claude is typed into the terminal

Root cause

Reading extension.js in the packaged extension, the openTerminal path creates a terminal and awaits a promise with
a hardcoded 3000ms fallback:

  await new Promise((resolve) => {
    onDidChangeTerminalShellIntegration((event) => {
      if (event.terminal === term) {
        onDidStartTerminalShellExecution((exec) => {
          if (exec.terminal === term) resolve();
        });
        event.shellIntegration.executeCommand("claude");
      }
    });
    setTimeout(() => {
      if (!term.shellIntegration) { term.sendText("claude"); resolve(); }
    }, 3000);
  });

With the happy path, the promise resolves on onDidStartTerminalShellExecution — which only fires after
executeCommand runs, adding real delay on top of extension activation.

Verified locally:

  • time zsh -i -c exit → 350ms
  • time claude --version → 50ms
  • Python ext venv auto-activation disabled
  • direnv output silenced — no interference with integration markers
  • Still ~5s from click to claude being typed

Request

Please either:

  1. Make the 3000ms timeout configurable (claudeCode.shellIntegrationTimeoutMs), or
  2. Short-circuit: if terminal.shellIntegration is already present after createTerminal, call executeCommand

immediately without waiting for the event.

claudeCode.useTerminal: false (webview) is a workaround but many some users (me) prefer the terminal path.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗