Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Cursor’s file watcher monitors all files in the workspace regardless of
.gitignore, .cursorignore, or .cursorindexingignore. When a
gitignored directory contains a large number of files (e.g., test output
with millions of files), the file watcher exhausts the system-wide file
descriptor limit (kern.maxfiles) on macOS, causing ENFILE (too many
open files) errors for all processes on the system, not just Cursor.
Even ps and lsof in a separate terminal fail with “too many open
files”.
Steps to Reproduce
- Create a gitignored directory in the workspace containing a large
number of files (e.g.,test/out/with 2M+ files from stress test
runs) - Open the workspace in Cursor
- Observe system-wide
ENFILEerrors in all terminals
Expected Behavior
The file watcher should respect .gitignore (similar to how search.useIgnoreFiles works for search). A single application should not be able to starve the entire system of file descriptors.
Operating System
MacOS
Version Information
Version: 2.6.20 (Universal)
VSCode Version: 1.105.1
Commit: b29eb4ee5f9f6d1cb2afbc09070198d3ea6ad760
Date: 2026-03-17T01:50:02.404Z
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0
Additional Information
Why keep test results in the workspace?
The tests results are useful for AI analysis. AI agent can search and analyze the results without special permissions.
Size example:
% tree ~/tmp/out | tail -1
354963 directories, 1768911 files
Workaround - set files.watcherExclude
Add files.watcherExclude to .vscode/settings.json:
{
"files.watcherExclude": {
"**/test/out/**": true
}
}
Workaround - don’t keep lot of files in the workspace
Move the files outside of the workapspace. Allow AI agent to access the directory with the tests results.
Does this stop you from using Cursor
Yes - Cursor is unusable