The Legacy Terminal option doesn't work anymore

Cursor IDE: Legacy Terminal Tool is ignored / “randomly” works — Investigation Dossier

Scope

This dossier documents an investigation of Cursor IDE terminal behavior on Windows (Cursor 2.3.34, OS 10.0.22631). The user-facing issue: enabling “Legacy Terminal Tool” does not consistently give an interactive agent terminal; instead Cursor often uses a read-only / review-mode terminal. Occasionally, Legacy Terminal appears “randomly” in some chats.

As requested, this file is laconic: evidence + what was tried + why it failed + a prompt for Cursor engineers.


Observed symptoms

  • The agent terminal frequently opens in a read-only/review pipeline (new terminal).
  • Sometimes, Legacy Terminal appears in one chat, but creating a new chat can immediately yield the new terminal again, without changing any settings.
  • The behavior is not reliably tied to workspace or to local configuration keys.

Key evidence (hard facts)

1) Server-driven flag forces review-mode terminal

From state.vscdb (cursorai/featureStatusCache), in both “Legacy chat” and “new terminal chat”:

  • enableReviewModeForTerminal: true

This strongly suggests the read-only terminal is controlled by a server-side feature flag, overriding local “legacy terminal” toggles.

2) Terminal executor initialized via ExtHostShellExec; sandbox helper missing on Windows

From exthost.log:

  • [ExtHostShellExec] Initializing terminal executor with userTerminalHint: C:\Program Files\PowerShell\7\pwsh.exe
  • [ExtHostShellExec] Sandbox helper path: not found
  • [ExtHostShellExec] Sandbox support detected: false

This indicates a new terminal execution pipeline (review-mode executor) is always attempted, even when sandbox support is unavailable.

3) Commands are intercepted via hooks

From cursor.hooks.log, every command goes through:

  • beforeShellExecution
  • afterShellExecution

This matches a “review / controlled execution” architecture.

4) Legacy flags are present locally but appear ineffective

Multiple keys were set in state.vscdb and/or settings.json such as:

  • cursor.useLegacyTerminalTool = true
  • cursor/useLegacyTerminalTool = true
  • terminal.useLegacy = true
  • workbench.terminal.useLegacy = true
  • cursor/terminalExecutionServiceV3HealthCheckResult = failed

Despite this, Cursor still commonly uses the review-mode terminal.

5) Per-chat non-determinism was observed

In the same window/workspace and with the same DB settings:

  • Chat A: Legacy Terminal (interactive) :white_check_mark:
  • Chat B (new): New terminal (read-only/review) :cross_mark:

This indicates terminal mode can be sticky per chat and can depend on initialization timing / fallback, not only on the global setting.


What was tried (and why it did not work)

A) Toggle “Legacy Terminal Tool” in Cursor settings UI

  • Result: ineffective / inconsistent.
  • Why: the actual execution pipeline is overridden by enableReviewModeForTerminal: true (server-driven), and/or the UI toggle does not reliably persist/apply.

B) Inject “legacy terminal” keys into state.vscdb and settings.json

  • Result: keys persist in DB/settings, but behavior largely unchanged.
  • Why: local keys appear not to be consulted for agent execution when review-mode is enabled by server.

C) Force V3 health-check failure

  • Result: insufficient to force interactive legacy mode.
  • Why: the system still uses the review-mode executor/hook pipeline.

D) “Offline start” to freeze server flags

  • Not feasible: the agent itself requires internet connectivity.
  • Note: a targeted block of feature-flag endpoints (Statsig/experiments) might be feasible, but the exact endpoint wasn’t reliably surfaced in available logs.

E) Find a stable per-workspace cache and delete it

  • Result: not proven to be the root cause.
  • Why: per-chat differences in the same workspace contradict “workspace cache is the only factor.”

Working theory (most consistent with evidence)

  1. Cursor enables a review-mode terminal execution path when enableReviewModeForTerminal: true.
  2. Legacy Terminal appears only as a fallback when the review-mode pipeline fails or is bypassed for that chat/session.
  3. The “random” appearance of Legacy is explained by timing / initialization / fallback conditions, not by user settings.

Minimal reproduction (for Cursor engineers)

  1. On Windows, ensure enableReviewModeForTerminal: true (default for affected users).
  2. Open any workspace.
  3. Create multiple agent chats and trigger terminal usage in each chat.
  4. Observe that some chats may still yield Legacy (interactive), while others yield the new read-only review terminal, despite identical settings.

Expected: behavior is inconsistent and not fully controlled by the UI toggle.


What Cursor engineers should run (Agent prompt for Cursor repo)

Copy-paste the following prompt into Cursor’s internal agent, with the Cursor repo opened:

Engineer Prompt

Goal: identify why “Legacy Terminal Tool” is ignored when enableReviewModeForTerminal=true,
and why some chats still end up with Legacy Terminal (fallback) while others use the new
read-only/review execution path.

Constraints:
- Keep behavior deterministic: same flags/settings -> same terminal mode.
- Add explicit logs that prove which branch was chosen and why.

Tasks:

1) Find the code path that reads enableReviewModeForTerminal.
   - Search for: enableReviewModeForTerminal, featureStatusCache, statsigBootstrap.

2) Find where terminal execution mode is chosen for agent commands.
   - Search for: ExtHostShellExec, terminal executor, terminalExecutionService, review mode terminal,
     beforeShellExecution, afterShellExecution, cursor-agent-exec.

3) Confirm precedence rules:
   - Does enableReviewModeForTerminal override the “Legacy Terminal Tool” setting?
   - If yes, is that intended? If intended, update UI wording and docs (toggle is misleading).
   - If not intended, fix precedence so the user toggle can force Legacy for agents.

4) Investigate non-determinism:
   - Locate any async initialization or “lazy” config loading that could race with terminal mode selection.
   - Ensure terminal mode is decided after config/flags are available.
   - Make the decision sticky per window/session (or globally), but not randomly per chat.

5) Add high-signal logs (guarded by a debug flag) that print:
   - terminal mode chosen (review vs legacy)
   - reasons (which flags/settings were read, their values)
   - whether sandbox helper is present
   - any fallback path taken

6) Add a regression test (unit/integration) that:
   - sets enableReviewModeForTerminal=true/false
   - sets “Legacy Terminal Tool” on/off
   - asserts the chosen execution mode is deterministic and matches the precedence policy.

Deliverables:
- Locations (files/functions) of the mode selection logic.
- A patch plan to make behavior deterministic and/or make the UI toggle effective.

Suggested search commands (run in repo):

- rg -n "enableReviewModeForTerminal|featureStatusCache|statsigBootstrap"
- rg -n "ExtHostShellExec|beforeShellExecution|afterShellExecution|terminal executor|review mode"
- rg -n "cursor-agent-exec|terminalExecutionService|Terminal.*Review"