MCPcopy Create free account
hub / github.com/continuedev/continue / isRunningInWsl

Function isRunningInWsl

extensions/cli/src/tools/runTerminalCommand.ts:32–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 * When running on Windows, but inside WSL, shell commands need to run using the WSL environment.
31 */
32export function isRunningInWsl(): boolean {
33 // WSL only applies when platform reports as Linux
34 if (process.platform !== "linux") {
35 return false;
36 }
37
38 if (process.env.WSL_DISTRO_NAME) {
39 return true;
40 }
41
42 // Check /proc/version for Microsoft/WSL indicators
43 try {
44 const procVersion = fs.readFileSync("/proc/version", "utf8").toLowerCase();
45 return procVersion.includes("microsoft") || procVersion.includes("wsl");
46 } catch {
47 return false;
48 }
49}
50
51function getBashMaxChars(): number {
52 return parseEnvNumber(

Callers 2

getShellCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected