smallrye / smallrye-common

Common utilities for SmallRye
Apache License 2.0
21 stars 24 forks source link

Add support for detecting WSL #311

Closed gsmet closed 5 months ago

gsmet commented 5 months ago

We have this in Quarkus:

    /**
     * @return {@code true} if the application is running in a WSL (Windows Subsystem for Linux) environment
     */
    public static boolean isWSL() {
        var sysEnv = System.getenv();
        return sysEnv.containsKey("IS_WSL") || sysEnv.containsKey("WSL_DISTRO_NAME");
    }

and I think it would make more sense in SmallRye Common (probably OS?).

Now, I don't know if this implementation is good enough or if we should follow what @dmlloyd suggested here: https://github.com/quarkusio/quarkus/pull/40497#discussion_r1596901248

gsmet commented 5 months ago

Thanks!