Skip to content

Commit

Permalink
Fix run editor error on windows with default terminal configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
Geequlim committed Jan 29, 2020
1 parent 0ac1299 commit 60937ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 7 additions & 4 deletions src/godot-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 60937ad

Please sign in to comment.