For the Front Matter Visual Studio Code extension, I needed to know if the current instance opened a Windows Subsystem for Linux (WSL) located project folder.
By knowing this context, I could ensure that certain functionality works similarly to the default behavior on Windows and macOS.
The solution is a very simple one-liner:
How I use it
I have two buttons in the Front Matter extension to open the project- and file folder in finder/explorer. When running in WSL, the
revealFileInOS command from VSCode is not available. You need to use the
remote-wsl.revealInExplorer command instead. With the one-liner, I can now do the following: