dsh-pocket 1.14.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/service.mjs +3 -1
- package/package.json +1 -1
package/lib/service.mjs
CHANGED
|
@@ -83,7 +83,9 @@ export function detectWsl() {
|
|
|
83
83
|
const v = readFileSync('/proc/version', 'utf8').toLowerCase();
|
|
84
84
|
if (v.includes('microsoft') || v.includes('wsl')) return true;
|
|
85
85
|
} catch { /* 非 Linux:无 /proc/version */ }
|
|
86
|
-
|
|
86
|
+
// 注意:**不能**用 WSLENV 判据——Windows Terminal 在原生 Windows 上也会设置
|
|
87
|
+
// WSLENV(如 WT_SESSION:WT_PROFILE_ID:),会误判成 WSL。只认 WSL 内部才有的变量。
|
|
88
|
+
return Boolean(process.env.WSL_DISTRO_NAME || process.env.WSL_INTEROP);
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
/**
|
package/package.json
CHANGED