[BUG]
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Title: Claude Code ignores iTerm2 cursor style settings and displays block cursor instead of configured thin bar
Description:
Claude Code is not respecting iTerm2's cursor style configuration. While all other iTerm2 tabs and windows display the configured thin vertical bar cursor, the Claude Code tab displays a thick block cursor.
Environment:
- OS: macOS (Darwin 24.6.0)
- Terminal: iTerm2
- Shell: zsh with Oh My Zsh + Powerlevel10k
- Claude Code version: [current version]
Expected Behavior:
The cursor in the Claude Code terminal tab should match the cursor style configured in iTerm2 Preferences → Profiles → Text → Cursor (set to "Vertical bar").
Actual Behavior:
Claude Code displays a thick block cursor regardless of iTerm2's cursor profile settings. This only affects the Claude Code tab - all other tabs in the same iTerm2 window correctly display the thin vertical bar cursor.
Steps to Reproduce:
- Configure iTerm2 with cursor style set to "Vertical bar" (Preferences → Profiles → Text → Cursor)
- Open Claude Code in iTerm2
- Observe that the cursor appears as a thick block instead of a thin vertical bar
- Open a new regular terminal tab in the same iTerm2 window - observe the cursor correctly shows as a thin vertical bar
Attempted Solutions:
- Adding ANSI cursor control escape sequences (\033[6 q) to .zshrc - commands output as literal text instead of being processed
- Adding cursor control to precmd_functions - same issue
- Using tput commands - escape sequences not processed
- All attempts show that escape sequences are being displayed as text rather than interpreted by the terminal
Additional Context:
Environment variables show CLAUDECODE=1 and CLAUDE_CODE_ENTRYPOINT=cli, confirming Claude Code is controlling the terminal environment. The issue appears to be that Claude Code's terminal implementation overrides iTerm2's cursor settings and doesn't process ANSI cursor control sequences sent via shell commands.
What Should Happen?
in iTerm2 the settings selected cursor should display in the terminal window that's running Claude code
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce:
- Configure iTerm2 cursor style:
- Open iTerm2 Preferences (⌘ + ,)
- Navigate to Profiles → (select your default profile) → Text
- In the "Cursor" section, select "Vertical bar"
- Ensure "Blinking cursor" is set to your preference
- Close Preferences
- Verify iTerm2 cursor works correctly:
- Open a new iTerm2 tab (⌘ + T)
- Observe that the cursor displays as a thin vertical bar
- Open multiple tabs/windows - all should show the thin vertical bar cursor
- Launch Claude Code:
- In a new iTerm2 tab, run: claude
- Or run: npx @anthropic-ai/claude-code
- Observe the cursor issue:
- Notice that the cursor in the Claude Code tab is now a thick block
- Switch between the Claude Code tab and other regular terminal tabs
- The regular tabs show the thin vertical bar (correct)
- The Claude Code tab shows a thick block (incorrect)
- Attempt to fix with shell commands (optional - to show issue persists):
- Try running: echo -ne '\033[6 q' (ANSI escape sequence for thin bar cursor)
- Observe that the escape sequence is output as literal text rather than being processed
- The cursor remains as a thick block
Expected Result:
The cursor in the Claude Code tab should match the iTerm2 profile setting (thin vertical bar).
Actual Result:
The cursor in the Claude Code tab displays as a thick block, ignoring iTerm2's cursor configuration.
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.29
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗