Disable launcher.bat script to unblock Git Bash users if windows username has blank spaces (#938)
* Disable launcher.bat script to unblock Git Bash users if windows user name has blank spaces Signed-off-by: Jinbo Wang <jinbwan@microsoft.com> * Use vscode.env.shell API to get current shell
This commit is contained in:
parent
e3c99ec889
commit
b2a4831995
|
@ -307,7 +307,10 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform === "win32" && config.console !== "internalConsole") {
|
if (process.platform === "win32" && config.console !== "internalConsole") {
|
||||||
config.launcherScript = utility.getLauncherScriptPath();
|
const launcherScript: string = utility.getLauncherScriptPath();
|
||||||
|
if (!launcherScript.includes(" ") || !utility.isGitBash(config.console === "integratedTerminal")) {
|
||||||
|
config.launcherScript = launcherScript;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (config.request === "attach") {
|
} else if (config.request === "attach") {
|
||||||
if (config.hostName && config.port) {
|
if (config.hostName && config.port) {
|
||||||
|
|
|
@ -215,6 +215,18 @@ export function getLauncherScriptPath() {
|
||||||
return path.join(ext.extensionPath, "scripts", "launcher.bat");
|
return path.join(ext.extensionPath, "scripts", "launcher.bat");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isGitBash(isIntegratedTerminal: boolean): boolean {
|
||||||
|
const currentWindowsShellPath: string | undefined = isIntegratedTerminal ? vscode.env.shell :
|
||||||
|
vscode.workspace.getConfiguration("terminal")?.get("external.windowsExec");
|
||||||
|
if (!currentWindowsShellPath) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const candidates: string[] = ["Git\\bin\\bash.exe", "Git\\bin\\bash", "Git\\usr\\bin\\bash.exe", "Git\\usr\\bin\\bash"];
|
||||||
|
const find: string | undefined = candidates.find((candidate: string) => currentWindowsShellPath.endsWith(candidate));
|
||||||
|
return !!find;
|
||||||
|
}
|
||||||
|
|
||||||
export enum ServerMode {
|
export enum ServerMode {
|
||||||
STANDARD = "Standard",
|
STANDARD = "Standard",
|
||||||
LIGHTWEIGHT = "LightWeight",
|
LIGHTWEIGHT = "LightWeight",
|
||||||
|
|
Loading…
Reference in New Issue