Hook Processing Fails on Windows with Git Bash Terminal

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor’s hook system fails on Windows when using Git Bash as the default terminal. The hook event decoder uses PowerShell syntax which is incompatible with Bash environments.

Environment

OS: Windows 10/11
Terminal: Git Bash (configured as default terminal in Cursor)

Steps to Reproduce

  1. Configure Git Bash as the default terminal in Cursor settings
  2. Trigger any action that invokes a Cursor hook (e.g., MCP tool execution, agent action)
  3. Observe the hook failure in STDERR

Expected Behavior

Hooks should execute successfully regardless of the configured terminal shell.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.x
Version: 2.2.x

Additional Information

Error Output
STDERR:

  • eval: line 1: syntax error near unexpected token ‘[Convert]::FromBase64String’
  • eval: line 1: “$b64=‘’; [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($b64)) | & { $input | }”

Root Cause Analysis

The hook processing mechanism hardcodes PowerShell syntax for decoding base64-encoded event payloads:
powershell[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($b64))
This .NET/PowerShell syntax is passed to the eval command, which fails in Bash environments.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report.

This is a known issue with hook compatibility across different shells on Windows. You correctly identified the cause: the hook system uses PowerShell syntax for base64 decoding, which isn’t compatible with Bash.

The team is already working on improving the hook system. For now, you can try:

  • Temporarily switching to PowerShell: Ctrl+Shift+P > “Terminal: Select Default Profile” > “PowerShell”
  • Enabling Legacy Terminal Tool in Settings > Features > Terminal

A similar issue was discussed here: AI Agent (Claude 4) runs commands in PowerShell even when default terminal is Git Bash

Could you also share the exact Cursor version (Menu → About Cursor → Copy)? You mentioned “2.1.x” and “2.2.x” - we’d like to confirm for tracking.

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