4 releases (breaking)

Uses old Rust 2015

0.4.0 Jan 27, 2023
0.3.0 Jan 23, 2023
0.2.0 Jan 22, 2023
0.1.0 Jan 21, 2023

#814 in Operating systems

Download history 46467/week @ 2024-09-06 43241/week @ 2024-09-13 48272/week @ 2024-09-20 51125/week @ 2024-09-27 54169/week @ 2024-10-04 52944/week @ 2024-10-11 56721/week @ 2024-10-18 55981/week @ 2024-10-25 57175/week @ 2024-11-01 56376/week @ 2024-11-08 60500/week @ 2024-11-15 59920/week @ 2024-11-22 63613/week @ 2024-11-29 67601/week @ 2024-12-06 68640/week @ 2024-12-13 44944/week @ 2024-12-20

254,513 downloads per month
Used in 321 crates (3 directly)

MIT license

5KB

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
    }
}

Dependencies

~49KB