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

#789 in Operating systems

Download history 39043/week @ 2024-07-21 41304/week @ 2024-07-28 39946/week @ 2024-08-04 44148/week @ 2024-08-11 43830/week @ 2024-08-18 41281/week @ 2024-08-25 46749/week @ 2024-09-01 45232/week @ 2024-09-08 44536/week @ 2024-09-15 48291/week @ 2024-09-22 52282/week @ 2024-09-29 53137/week @ 2024-10-06 54775/week @ 2024-10-13 55478/week @ 2024-10-20 57922/week @ 2024-10-27 55245/week @ 2024-11-03

227,896 downloads per month
Used in 299 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

~50KB