`cursor` in CLI hangs indefinitely

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

I attempted troubleshooting the issue and discovered this only happens when running within iterm 2. I’m on Mac w/ an M1 chip.
I have open -a Cursor . aliased as a workaround, and agent works fine somehow.

• Cursor: 2.5.17 (7b98dcb8)
• macOS: 26.2 (25C56)
• Arch: arm64 (Apple Silicon)
• iTerm2: 3.6.6
• Shell: zsh 5.9
• Terminal.app: works correctly (same machine, same shell config)

Steps to Reproduce

cursor in the CLI. simply hangs and doesn’t do anything.

Expected Behavior

cursor -n . should open the cursor IDE from the current directory.

Operating System

MacOS

Version Information

CLI Version 2026.02.13-41ac335
Model Claude 4.6 Opus (Thinking)
OS darwin (arm64)
Terminal iterm2
Shell zsh
Cursor: 2.5.17 (7b98dcb8)
macOS: 26.2 (25C56)
Arch: arm64 (Apple Silicon)
iTerm2: 3.6.6
Shell: zsh 5.9
Terminal.app: works correctly (same machine, same shell config)

Additional Information

Investigation Details

The hang occurs in the Electron-as-Node process. The CLI script at /usr/local/bin/cursor ultimately runs:

ELECTRON_RUN_AS_NODE=1 “/Applications/Cursor.app/Contents/MacOS/Cursor” “/Applications/Cursor.app/Contents/Resources/app/out/cli.js” [args]

This Electron process hangs when its parent is iTerm2’s pty. Tested and ruled out:
• iTerm2 environment variables (__CFBundleIdentifier, ITERM_SESSION_ID, ITERM_PROFILE, LC_TERMINAL, LC_TERMINAL_VERSION, COLORFGBG) – unsetting all of these does NOT fix the hang
• tmux – hangs both inside and outside tmux within iTerm2
• stdin redirection (cursor -n . </dev/null) – does NOT fix the hang
• Reinstalling Cursor – does not fix the hang
• PATH issues – ruled out; the correct binary is resolved

The issue appears to be in how the Electron binary interacts with iTerm2’s pseudo-terminal at a lower level than environment variables.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

I wonder if this is related :up_arrow:

Hey, thanks for the report. The troubleshooting you already did is especially helpful.

I’ve passed this along to the team. There isn’t a specific fix yet, but your workaround with open -a Cursor . is the most reliable option right now. You can also try:

ELECTRON_RUN_AS_NODE=1 nohup "/Applications/Cursor.app/Contents/MacOS/Cursor" "/Applications/Cursor.app/Contents/Resources/app/out/cli.js" "$@" &

If this also hangs in iTerm2, that would confirm the issue is with the PTY interaction.

One question. Have you already tried other terminal apps like Warp, Alacritty, or Kitty? I’m trying to figure out if this is iTerm2-specific or if it affects all non-Terminal.app terminals.

Let me know if anything changes.

I haven’t tried other Mac terminals, I only installed iTerm2 to make theming my terminal easier.

This frustrated me to no end, so I also threw gemini at it. With a small edit to the cursor shim it’s working again. I was avoiding editing the shim when chatting with the cursor agent bc I didn’t want to run into maintenance / compatibility issues on cursor updates, but this is simple enough I’m fine with it.

Gemini’s explanation of the fix:
I will update the find_cursor script to use the -ef operator, ensuring it correctly identifies the current shim even with different path representations, preventing infinite recursion in iTerm2.

This “fix” needs to be implemented by the devs to be permanent ofc. It’s only temporary until the next update.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.