1 unstable release
| 0.1.0 | Jun 12, 2019 |
|---|
#517 in Windows APIs
66,188 downloads per month
Used in 14 crates
(9 directly)
3KB
Detect if the program is running under Windows Subsystem for Linux
Usage
wsl::is_wsl()
Detect if the code is ran under Windows Subsystem for Linux
Usage
wsl::is_wsl() returns true under WSL, false otherwise.
Method
A semi-official source lists some pointers. We are going to use the simplest approach here: Testing if /proc/sys/kernel/osrelease contains string Microsoft or WSL.