Sublime Forum

Sublime 4: New folder doesn't appear

#1

new folder and files doesn’t appear after creation when using sublime with wsl 2.

0 Likes

#2

That’s because WSL environments don’t create filesystem notifications, which ST relies on to pickup changes. That’s a WSL issue.

0 Likes

#4

Hi, What I need to do, to make it work? Thank you :slight_smile:

0 Likes

#5

Patch WSL implementation :wink:

ST manages all information about open files in RAM. This is how Goto Anything and other advanced functions are powered. Those in RAM information are updated by filesystem notifications. As WSL doesn’t create inotifiy or doesn’t forward those to Windows layer ST doesn’t get informed about changes.

That’s nothing which can be fixed by the application or end users. It requires Microsoft to correctly create and forward them. Thus it needs to be fixed in WSL code.

0 Likes

#6

Yes, looks like there’s lots of discussion about it

0 Likes

#8

Thank you. But I don’t understand why it works well with VS Code and Web Storm

0 Likes

#9

Most likely they use a polling file watcher as a fallback if it’s detected that the root dir is a WSL path, instead of using inotify.

I know from experience that inotify is also broken for network-mapped directories in Linux. A polling file watcher is a necessity I think.

EDIT: as fallback of course. Unsure how you would detect whether a random path is suitable for inotify or when you would be required to use a poller.

0 Likes

#10

Then again there’s this blog post from 2016 that claims that inotify works out of the box https://devblogs.microsoft.com/commandline/wsl-adds-inotify-filesystem-change-notification-support/

I guess SublimeHQ needs to spend resources on making the experience more seamless.

0 Likes

#11

That’s for WSL1, which supported filesystem notifications just fine. IIRC WSL2 drops that, as you’d need a fair amount of modification/communication between the two independent kernels.

0 Likes

#12

I’ve added an issue for adding a polling filesystem watcher, as this seems like the only solution. https://github.com/sublimehq/sublime_text/issues/4222

1 Like