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

#816 in Operating systems

Download history 55030/week @ 2024-10-24 57955/week @ 2024-10-31 56379/week @ 2024-11-07 59509/week @ 2024-11-14 60693/week @ 2024-11-21 62935/week @ 2024-11-28 67108/week @ 2024-12-05 67735/week @ 2024-12-12 50468/week @ 2024-12-19 43542/week @ 2024-12-26 65999/week @ 2025-01-02 76627/week @ 2025-01-09 75574/week @ 2025-01-16 85499/week @ 2025-01-23 84165/week @ 2025-01-30 83865/week @ 2025-02-06

342,496 downloads per month
Used in 228 crates (5 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

~65KB