Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
The AI Agent terminal in Cursor runs in a restricted, non-interactive zsh mode, stripping aliases, redirecting stdin to /dev/null, setting TERM=dumb (disabling colors and capabilities), and isolating the environment (no inheritance of user vars like AWS SSO credentials or KUBECONFIG). This breaks interactive workflows, especially AWS SSO authentication and kubectl operations, causing “Unauthorized” errors. The issue started ~3 updates ago (v1.7.14-1.7.15) and affects macOS users with Oh My Zsh. Process inspection shows hardcoded non-interactive execution: /bin/zsh -o extendedglob -c snap=$(command cat <&3); builtin unsetopt aliases … eval “$1” < /dev/null; … dump_zsh_state >&4. Terminal flashes white on click, refusing input, and state doesn’t persist across commands.
Steps to Reproduce
Open Cursor (v1.7.17+) on macOS with zsh/Oh My Zsh as default shell.
Invoke AI Agent (e.g., Cmd+I or via Composer).
In the Agent terminal, run: kubectl get pods -n develop (after authenticating AWS SSO in your external terminal).
Observe: “error: You must be logged in to the server (Unauthorized)” despite valid SSO session.
Run: ps -p $$ -o args= → Shows non-interactive zsh with aliases disabled and stdin null-redirected.
Run: echo $TERM → “dumb” (no colors in ls --color=auto).
Run: aws configure sso → No interactive prompt (fails silently).
Click in terminal → Flashes white, no input accepted.
Export a var (e.g., export FOO=bar) then echo $FOO in next command → Doesn’t persist.
Reproduces 100% on Apple Silicon MacBooks (macOS 14.5+).
Expected Behavior
Terminal runs interactive zsh (-i mode), sourcing ~/.zshrc/Oh My Zsh for aliases, themes, autocomplete, and custom PS1.
Inherits user environment: AWS SSO creds, KUBECONFIG, PATH, etc., from parent shell.
Sets TERM=xterm-256color for colors, cursor support, and full capabilities.
Supports stdin/stdout for prompts (e.g., aws configure sso opens browser flow).
State persists (e.g., cd/export carries over commands).
Accepts input without flashing; behaves like external iTerm2/Terminal.app.
Screenshots / Screen Recordings
![]()
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.7.28 (Universal)
VSCode Version: 1.99.3
Commit: adb0f9e3e4f184bba7f3fa6dbfd72ad0ebb8cfd0
Date: 2025-10-01T02:45:21.769Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0
For AI issues: which model did you use?
Every model does the same thing - primarily use claude-4.5 max
For AI issues: add Request ID with privacy disabled
7d40c81f-a74c-4014-97b6-43193763bff3
Additional Information
System/Env Details:
OS: macOS 14.5 (Darwin arm64 24.5.0, Apple Silicon MacBook Pro x2).
Shell: /opt/homebrew/bin/zsh with Oh My Zsh (aliases, p10k theme).
Terminal: iTerm2 (external works fine).
Use Case: AWS SSO + Kubernetes (kubectl); interactive dev workflows.
Root Cause (RCA):
Agent terminal executes in sandboxed subshell for safety/CI-like runs, but unsuitable for interactive use:
Explicitly disables aliases: builtin unsetopt aliases; builtin unalias -m ‘*’.
Blocks input: eval “$1” < /dev/null.
Isolates env: No ~/.zshrc sourcing; test creds (AWS_ACCESS_KEY_ID=test) override user SSO.
Captures state via undefined dump_zsh_state >&4 (causes errors/hangs).
TERM=dumb limits to non-interactive output.
Impact: Critical—blocks cloud infra management (AWS auth, kubectl). Forces manual cred passing (security risk, unsustainable). No colors/PS1 slows debugging. Affects multiple users (see related threads: [link to forum post on env inheritance], [link to zsh persistence bug]). Regression from pre-v1.7.14 (worked seamlessly).
Workarounds (Limited):
settings.json: “terminal.integrated.env.osx”: {“TERM”: “xterm-256color”, “AWS_PROFILE”: “your-profile”} + “terminal.integrated.shellIntegration.enabled”: false.
.zshrc conditional: if [[ -n “$CURSOR_AGENT” ]]; then export AWS_* vars; skip p10k; fi.
Downgrade risky (chat history loss).
Proposed Fixes:
Add -i flag for interactive zsh.
Inherit user env (capture AWS/KUBECONFIG).
Set TERM=xterm-256color.
Source ~/.zshrc; define dummy dump_zsh_state() { :; }.
User toggle: “cursor.terminal.mode”: “interactive”.
Test Cases:
kubectl get pods succeeds post-SSO.
echo $TERM = xterm-256color; colors in git status.
export FOO=bar; echo $FOO persists.
aws configure sso prompts browser.
Request escalation—widespread on forums since Sep 2025. Happy to provide video/logs.
Does this stop you from using Cursor
Yes - Cursor is unusable