VS Code unable to watch for file changes in CentOS with tcsh shell

50 Views Asked by At

I'm encountering an issue with Visual Studio Code on Linux. The problem is that VS Code is unable to watch for file changes in my workspace, even though files.watcherExclude is configured and I certainly have a small file count. I'm launching VSC from shell.

Setup details:

  • System: CentOS

  • Shell: tcsh

  • Workspace Structure:

    workspace-folder/
    ├── dev/
    │   └── code/
    │       └── .vscode/
    ├── data/
    └── results/
    

    Please note that the git repository is located in the code folder, which is the only directory that VSC should monitor. The data and results folders are included in the workspace solely for periodic inspection.

I have configured the files.watcherExclude setting in VS Code as follows:

"files.watcherExclude": {
    "code/.git/objects/**": true,
    "code/.git/subtree-cache/**": true,
    "code/node_modules/*/**": true,
    "code/node_modules": true,
    "code/.hg/store/**": true,
    "**/.git/objects/**" : true,
    "**/.git/subtree-cache/**": true,
    "**/node_modules/*/**": true,
    "**/node_modules": true,
    "**/.hg/store/**": true,
    "**/data/**": true,
    "**/results/** ": true,
    "**/__pycache__/**": true,
    "**/.pytest_cache/**": true
}

I've come across this PR which inspired my files.watcherExclude configuration. I have attempted to make the paths explicit to address the problem.

I've also ran couple of commands to count files and symlinks in workspace-folder. Outputs:

$ find -L /workspace-folder -type f | wc -l
1923
$ find /workspace-folder -type l | wc -l
0
$ find -L /workspace-folder/dev/code -type f | wc -l
207
$ find /workspace-folder/dev/code -type l | wc -l
0

I have already reviewed the solutions mentioned in the Visual Studio Code documentation and the following answers (among many others) (1, 2) regarding increasing the number of watches. However, these solutions require sudo privileges, which I do not have.

Questions:

  1. How is it possible for the VS Code file watcher to exceed 8000+ files, while my entire file count is under 1500?
  2. Can you provide any hints or suggestions on how to solve this problem without requiring sudo privileges?
0

There are 0 best solutions below