WSLDistribution (@Nullable String interpreterPath, @Nullable @NlsSafe String scriptPath) { if (!WSLUtil.isSystemCompatible()) return null; if (EnvironmentUtil.getValue("SHELL") != null) return null; if (scriptPath != null && (scriptPath.endsWith("cmd") || scriptPath.endsWith("bat"))) return null; WslPath wslPath = interpreterPath != null ? WslPath.parseWindowsUncPath(interpreterPath) : null; if (wslPath == null && scriptPath != null) { wslPath = WslPath.parseWindowsUncPath(scriptPath); } return wslPath != null ? wslPath.getDistribution() : null; }