When using cursor hooks on Windows platform, especially afterEdit hooks, when the input content is too large, it will cause error output to directly report execution error: spawn ENAMETOOLONG, resulting in the user’s callback program not executing and cannot take effectWhen using cursor hooks on Windows platform, especially afterEdit hooks, when the input content is too large, it will cause error output to directly report execution error: spawn ENAMETOOLONG, resulting in the user’s callback program not executing and cannot take effect
Hey @_lonelywaitingliu ,
The ENAMETOOLONG error when hooks receive large file payloads has been fixed, it will be included in a future stable update. If you’re on an early access track, updating to the latest version may already include the fix.
@weixiang - The fix is already available on the current stable release. Updating Cursor should resolve the issue: Ctrl+Shift+P > Attempt Update, then restart.
Let us know if the problem persists after updating.
The error you’re seeing (spawn E2BIG) is actually a different error from the original ENAMETOOLONG that was fixed. The earlier fix resolved the issue on Windows, but on macOS, when the file content exceeds a certain size (which a 17,000+ line file would), the hook payload hits a different OS-level limit that the original fix didn’t cover.
This is a known issue that our team is actively working on. Unfortunately there’s no workaround at the moment since it’s a limitation in how the hook payload is delivered to the script on macOS/Linux.