Files not syncing on WLS 2
Answered
I'm currently working on my Windows 10 machine with WSL2. But I'm having sync issues whenever I edit some file. In order to make the filesystem aware of this changes, I have to go to File -> Reload All from Disk.
I don't know if this is my issue, or WSL known bug, but this is the first time using IntelliJ Ultimate Edition with WSL2 (Ubuntu 20) and VcXsrv for the GUI.
Can you help me? Thanks!
EDIT: I'm not opening project from /mnt/ folder, I'm using the WSL filesystem.
Please sign in to leave a comment.
File system notifications are not supported inside WSL yet: https://youtrack.jetbrains.com/issue/IDEA-240351 .
Serge Baranov I have this issue as well, and I believe the OP (as well as myself) are describing this as an issue when a Jetbrains IDE is run _within_ WSL2 itself. The issue you linked seems related to running the IDE in Windows when the project files are in WSL. However, I have this issue when my files and the IDE are all running from within WSL2 Ubuntu 20.04.
Please share the logs (Help | Collect Logs and Diagnostic Data) at https://uploads.jetbrains.com.
It appears that the "Save files if the IDE is idle for XX seconds" does work, but not "Save files when switching to a different application" or "Synchronize external changes when switching to the IDE window" -- I think "opening an editor tab" seems to also work.
Upload id: 2021_02_25_X36DKJcepy7o4Sei (file: idea.1.log)
The steps I took that are (maybe) included in this log were (let me know if I need higher logging levels anywhere):
1. Launch IDE
2. Change settings for autosave on idle from 5 seconds back to 15 (To enable better testing/logs. Putting at 5s is my workaround for udpates made w/in the IDE to persist to the filesystem)
3. Changed a file w/in the filesystem and changed windows (tried changing to another IDE window also running in WSL2, as well as windows running under Windows 10). Ultimately the file saved after 15s of the IDE being idle.
4. Changed a file using VIM and saved. The file changes never showed up in the IDE. Changes ultimately showed up when I selected "Reload From Disk".
It's a known issue: https://youtrack.jetbrains.com/issue/IDEA-240600.
I'm using XcXsrv for GUI display of this IDE that's running in WSL2 if that matters. I run it at startup via:
"C:\Program Files\VcXsrv\vcxsrv.exe" :0 -ac -terminate -lesspointer -multiwindow -clipboard -wgl -dpi auto
edit Just saw your post. Ok, thanks.