Windows 11: Git commit fails first in Cursor $(cat <<'EOF'

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Hi Cursor Support team,

I’m on Windows 11 and noticed that whenever Cursor initiates a commit, it first attempts a bash-style combined command that fails, and then it falls back to a different approach that works (running git add and git commit sequentially). It’s not an infinite loop, but it’s consistent: every commit attempt triggers the failing command first.

What happens

  1. Cursor tries this command first (fails on Windows shell):
git add notebooks/*.ipynb ; git commit --trailer "Co-authored-by: Cursor <[email protected]>" -m "$(cat <<'EOF'
Pin XYZLibrary==0.14.0 and add Colab runtime_version metadata to all notebooks

- Pin XYZLibrary to ==0.14.0 across all 18 notebooks (4 install patterns:
  %pip, !pip, %pip with mlflow, pip_install helper)
- Add runtime_attributes.runtime_version: "2025.10" to Colab metadata in all
  18 notebooks to pin the Colab runtime and avoid trl/transformers version
  mismatch errors
EOF
)"

This uses:

  • ; to chain commands
  • cat <<'EOF' ... EOF heredoc to build the commit message

Those are typically bash/zsh features and often fail under PowerShell/cmd.

  1. After it fails, Cursor switches to a working method:
  • git add ...
  • then git commit ...
    (run as separate commands. They run successfully)

Why I’m posting

Even though the fallback works, the initial failure adds noise, slows down commit actions and waste tokens.

Thanks!

Steps to Reproduce

  1. On Windows 11, open any git repository in Cursor.
  2. Make changes to one or more files (any text files are fine).
  3. Ask Cursor to commit all the changes. Make sure it has a long commit message.
  4. Observe that Cursor first runs a bash-style combined commit command (with ; and heredoc-style cat <<'EOF' ... EOF) which fails.
  5. Cursor then falls back to running git add and git commit as separate commands, which succeeds.
  6. Repeat step 3 — the same “fail first, then succeed” pattern happens again on every commit attempt.

Expected Behavior

It uses correct commit command(s).

Operating System

Windows 10/11

Version Information

Cursor version info

Version: 2.4.31 (system setup)
VSCode Version: 1.105.1
Commit: 3578107fdf149b00059ddad37048220e41681000
Date: 2026-02-08T07:42:24.999Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Claude Opus 4.6 (MAX).

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This looks like a bug. The agent shouldn’t generate bash-specific syntax like heredocs or chaining commands with ; when it’s running in the Windows shell.

Here are a few workarounds you can try:

  1. Add a project rule in .cursor/rules or a user rule that tells the agent to use PowerShell-compatible syntax for terminal commands on Windows. For example: “When running terminal commands on Windows, use PowerShell-compatible syntax. Don’t use bash features like heredocs or semicolons for chaining commands.”

  2. Check which shell profile Cursor is using: Settings Ctrl+, then search for “terminal default profile windows” and make sure PowerShell or cmd is explicitly selected.

Let me know if the rule helps reduce the noise.

1 Like


It’s cursor bug

Looks fixed now

1 Like

Doesn’t look fixed now 0_0