is-wsl

Crates.iois-wsl
lib.rsis-wsl
version0.4.0
sourcesrc
created_at2023-01-21 20:55:59.232721
updated_at2023-01-27 19:50:09.059226
descriptionChecks if the process is running inside Windows Subsystem for Linux.
homepage
repositoryhttps://github.com/TheLarkInn/is-wsl
max_upload_size
id764596
size6,979
Sean Larkin (TheLarkInn)

documentation

README

is-wsl

Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)

Inspired by sindresorhus/is-wsl and made for Rust lang.

Can be useful if you need to work around unimplemented or buggy features in WSL. Supports both WSL 1 and WSL 2.

Usage

$> cargo add is-wsl

main.rs


use is_wsl::is_wsl

fn main() {
    if is_wsl() {
        // Do some WSL related stuff 🎇
    } else {
        // Do some different things! <3
    }
}
Commit count: 12

cargo fmt