Skip to content

Instantly share code, notes, and snippets.

@iamfoysal
Last active January 1, 2023 13:52
Show Gist options
  • Save iamfoysal/e3e840b46a1a32d2e42e2ca9c6d20348 to your computer and use it in GitHub Desktop.
Save iamfoysal/e3e840b46a1a32d2e42e2ca9c6d20348 to your computer and use it in GitHub Desktop.
vs code unable to watch for file changes in this large workspace

[The fact that you are out of watches does not mean that its VSCode's fault.]

Let's fix it

  • Open a new terminal.

  • You can get your current inotify file watch limit by executing:

      $ cat /proc/sys/fs/inotify/max_user_watches
    
  • You can set a new limit temporary with:

      $ sudo sysctl fs.inotify.max_user_watches=524288
    
      $ sudo sysctl -p
    
  • If you like to make your limit permanent, use:

      $ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
    
    
      $ sudo sysctl -p
    

    return:

      fs.inotify.max_user_watches = 524288
    
  • Thank me later :3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment