Skip to content

Detect if the program is running under Windows Subsystem for Linux

License

Notifications You must be signed in to change notification settings

Dentosal/wsl-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Detect if the code is ran under Windows Subsystem for Linux

On crates.io

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.

About

Detect if the program is running under Windows Subsystem for Linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages