GitShow/sindresorhus/is-wsl
sindresorhus

is-wsl

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

by sindresorhus
Star on GitHubForknpm

JavaScript

198 stars10 forks7 contributorsQuiet · 4mo agoSince 2017v3.1.1MIT

Meet the team

See all 7 on GitHub →
sindresorhus
sindresorhus19 contributions
coreyfarrell
coreyfarrell1 contribution
BendingBender
BendingBender1 contribution
KyivJunta
KyivJunta1 contribution
PVermeer
PVermeer1 contribution
mwcoomber
mwcoomber1 contribution
justjavac
justjavac1 contribution

Languages

View on GitHub →
JavaScript98.1%
TypeScript1.9%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
aswild
WSL not detected when running a custom kernelClosedIssue

The fundamental check in this package is effectively equivalent . But you can run custom Linux kernels with arbitrary version strings inside WSL2, so this check is fragile and unreliable. There's no 100% reliable solution that I'm aware of, but there's some additional indicators that strongly point to a Linux environment being WSL2: The environment variable is set. VS Code's launcher script uses this, though obviously programs may be running with sanitized environment variables so an absence of this doesn't guarantee that we're not WSL. The existence of some mountpoints and paths that are distro-independent. If any of these exist, we're probably in WSL (and probably not in a container)

aswild · 4mo ago
kyubisation
Add `DISABLE_IS_WSL` as an escape hatchMergedPR

Currently there is no way to to disable , which leads to undesired effects with tools consuming . As an example the Web Test Runner will try to use the Chrome binary from Windows, even when Chrome is installed in WSL. This PR introduces usage of the environment variable to disable the functionality. This allows consumers of downstream tools to prevent undesired calls to Windows binaries as an opt-in.

kyubisation · 7mo ago
mwcoomber
Replacing is-docker with is-inside-containerMergedPR

Using is-inside-container to cover the case when running a podman container from inside WSL.

mwcoomber · 2y ago
Structured data for AI agents

Repository: sindresorhus/is-wsl. Description: Check if the process is running inside Windows Subsystem for Linux (Bash on Windows) Stars: 198, Forks: 10. Primary language: JavaScript. Languages: JavaScript (98.1%), TypeScript (1.9%). License: MIT. Latest release: v3.1.1 (4mo ago). Open PRs: 0, open issues: 0. Last activity: 4mo ago. Community health: 85%. Top contributors: sindresorhus, coreyfarrell, BendingBender, KyivJunta, PVermeer, mwcoomber, justjavac.

·@ofershap

Replace github.com with gitshow.dev