UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

15 lines • 683 B
import { readFileSync } from "node:fs"; /** Windows Subsystem for Linux, where Windows executables are reachable through interop. Linux-only by contract: callers on other platforms must guard with a platform check (as keybindings and the footer provider do), because `WSLENV` can also be set on native Windows. */ export function isWSL(env = process.env, procVersionPath = "/proc/version") { if (env.WSL_DISTRO_NAME || env.WSL_INTEROP || env.WSLENV) { return true; } try { const release = readFileSync(procVersionPath, "utf-8"); return /microsoft|wsl/i.test(release); } catch { return false; } } //# sourceMappingURL=wsl.js.map