Fix run editor error on windows with default terminal configurations

This commit is contained in:
Geequlim
2020-01-30 00:11:23 +08:00
parent 0ac1299f47
commit 60937ad776
2 changed files with 8 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
"name": "godot-tools",
"displayName": "godot-tools",
"icon": "icon.png",
"version": "1.0.0",
"version": "1.0.1",
"description": "Tools for game development with godot game engine",
"repository": "https://github.com/godotengine/godot-vscode-plugin",
"author": "The Godot Engine community",

View File

@@ -68,10 +68,13 @@ export class GodotTools {
const run_godot = (path: string, params: string) => {
const escape_command = (cmd: string) => {
let cmdEsc = `"${cmd}"`;
const shell_plugin = vscode.workspace.getConfiguration("terminal.integrated.shell");
let shell = shell_plugin ? shell_plugin.get("windows", "") || "" : "";
if (process.platform === "win32" && shell.endsWith("powershell.exe")) {
cmdEsc = `&${cmdEsc}`;
if (process.platform === "win32") {
const POWERSHELL = "powershell.exe";
const shell_plugin = vscode.workspace.getConfiguration("terminal.integrated.shell");
let shell = (shell_plugin ? shell_plugin.get("windows", POWERSHELL) : POWERSHELL) || POWERSHELL;
if (shell.endsWith(POWERSHELL)) {
cmdEsc = `&${cmdEsc}`;
}
}
return cmdEsc;
};