microsoft / microsoft/vscode

WSL2: VS Code Remote‑WSL File‑Watcher Not Receiving Inotify Events Despite Correct Path, Inode, and Healthy WSL Server

Open
#324,372 5 comments 0 reactions 1 assignee Claimed by @lszomoru View on GitHub
info-needed
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

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

- VS Code Version: 1.125.1
- OS Version: Windows_NT x64 10.0.26200

Steps to Reproduce:

WSL File‑Watcher Failure — Fully Isolated, Engineering‑Grade Diagnostic Report

Summary

VS Code (Remote‑WSL) fails to detect file changes in WSL2 even though:

WSL inotify is functioning correctly

VS Code WSL server is running normally

VS Code fileWatcher process is running normally

VS Code resolves the correct workspace path

VS Code resolves the correct inode

No external causes remain

This isolates the failure to VS Code’s internal WSL file‑watcher subsystem.

Environment

Windows host

WSL2 distro: CFA‑Loc

Shell: bash

Workspace directory: /mnt/c/fvi/cfa

VS Code launched exclusively via Safe Shortcut:

Code

wsl.exe -d CFA-Loc --cd /mnt/c/fvi/cfa -- bash -lc "code --new-window ."

No symlinks, bind mounts, alternate workspace paths, or duplicate repos

Repo exists only at /mnt/c/fvi/cfa

Reproduction Steps (Minimal and Deterministic)

Launch VS Code using the Safe Shortcut above.

Inside WSL (same directory VS Code is attached to), modify a file:

Code

echo "test" >> vs-code-inotify-test.txt

Observe:

File changes appear on disk

WSL shell sees the change

VS Code integrated terminal sees the change

VS Code Source Control shows no unstaged changes

This reproduces the failure 100% of the time.

Verification Data (All External Causes Eliminated)

1. Path Resolution (matches)

WSL shell:

Code

pwd
/mnt/c/fvi/cfa

VS Code terminal:

Code

pwd
/mnt/c/fvi/cfa

VS Code is attached to the correct directory.

2. Inode Resolution (matches)

WSL shell:

Code

ls -i vs-code-inotify-test.txt
32932572275186180 vs-code-inotify-test.txt

VS Code terminal:

Code

ls -i vs-code-inotify-test.txt
32932572275186180 vs-code-inotify-test.txt

VS Code is resolving the correct inode.

3. VS Code WSL Server Processes (all healthy)

ps aux | grep -i vscode shows:

wslServer.sh

code-server

server-main.js

extensionHost

fileWatcher (present and running)

language servers

No crashes, no restarts, no duplicates, no errors.

4. Inotify Behavior

WSL kernel successfully fires inotify events. VS Code does not receive them.

This eliminates:

WSL kernel issues

Filesystem issues

Permission issues

Repo issues

Mount namespace issues

Path resolution issues

Inode resolution issues

Shortcut issues

Duplicate workspace issues

Conclusion

All external causes have been eliminated. The failure is isolated to:

VS Code’s WSL file‑watcher subsystem not receiving inotify events despite correct attachment, correct path, correct inode, and correct environment.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.