I would like to identify when Emacs is running on WSL (Windows Subsystem for Linux).
Normally I use
system-type variable to check if Emacs is on Linux, Windows or MacOS X.
Though in this case it returns
system-type is a variable defined in ‘C source code’. Its value is ‘gnu/linux’ Documentation: The value is a symbol indicating the type of operating system you are using. Special values: ‘gnu’ compiled for a GNU Hurd system. ‘gnu/linux’ compiled for a GNU/Linux system. ‘gnu/kfreebsd’ compiled for a GNU system with a FreeBSD kernel. ‘darwin’ compiled for Darwin (GNU-Darwin, macOS, ...). ‘ms-dos’ compiled as an MS-DOS application. ‘windows-nt’ compiled as a native W32 application. ‘cygwin’ compiled using the Cygwin library. Anything else (in Emacs 26, the possibilities are: aix, berkeley-unix, hpux, usg-unix-v) indicates some sort of Unix system.
Which is what it is expected, though...
I want to add a specific check to use the Windows native browser, not the one on WSL.
I currently do that setting:
(setq browse-url-browser-function 'my-browse-url-function)
But I only want to do this in WSL, not in real Linux.
Is there a way to do it?