Skip to content

files.watcherExclude setting does not respect relative paths and folders outside the workspace are being watched #311908

@kliang-stripe

Description

@kliang-stripe

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.117.0
  • OS Version: macOS Tahoe v26.3.1

When VSCode is opened in a workspace/folder inside a repository, the VSCode file watcher watches folders outside of the workspace and does not respect relative paths in the files.watcherExclude setting. It seems like something is watching the repository at its root. I'm connected to a remote machine using the Remote - SSH extension.

Steps to Reproduce:

  1. Clone this toy repo: https://github.com/kliang-stripe/repro-file-watch.
  2. Open the repo in VSCode with folder A/ as the workspace.
  3. Find the PID of the VSCode file watcher.
  4. Find the files that the file watcher is watching. To do this, I cloned https://github.com/mikesart/inotify-info, ran make, and followed https://github.com/mikesart/inotify-info#run-with-specific-pids (_release/inotify-info {PID}) to get the files that were being watched.
  5. Notice that folders B/, C/, and A/to-ignore are being watched. This is buggy because only A/ is opened in VSCode and in A/.vscode/settings.json, we exclude A/to-ignore from file watching.
  6. In A/.vscode/settings.json, uncomment the rest of the files in the files.watcherExclude setting.
  7. Close and re-open VSCode with folder A/ as the workspace.
  8. Repeat steps 3-4.
  9. Notice that folders B/, C/, and A/to-ignore are no longer being watched.

Metadata

Metadata

Assignees

Labels

staleIssues that have not been triaged in an appropriate amount of timetriage-needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions