Skip to content

Commit

Permalink
configurationProvider.ts: use integratedTerminal for cl.exe
Browse files Browse the repository at this point in the history
  • Loading branch information
caiohamamura committed Jun 1, 2023
1 parent 9621430 commit e466cac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Extension/src/Debugger/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,11 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv

newConfig.name = configPrefix + compilerName + " " + this.buildAndDebugActiveFileStr();
newConfig.preLaunchTask = task.name;
const isCl: boolean = compilerName === "cl.exe";
if (newConfig.type === DebuggerType.cppdbg) {
newConfig.externalConsole = false;
} else if (isCl) {
newConfig.console = "integratedTerminal";
} else {
newConfig.console = "externalTerminal";
}
Expand All @@ -450,7 +453,6 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
if (task.isDefault) {
newConfig.isDefault = true;
}
const isCl: boolean = compilerName === "cl.exe";
newConfig.cwd = isWindows && !isCl && !process.env.PATH?.includes(path.dirname(compilerPath)) ? path.dirname(compilerPath) : "${fileDirname}";

// eslint-disable-next-line @typescript-eslint/no-misused-promises
Expand All @@ -475,7 +477,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
}
}
newConfig.type = DebuggerType.cppdbg;
} else if (compilerName === "cl.exe") {
} else if (isCl) {
newConfig.miDebuggerPath = undefined;
newConfig.type = DebuggerType.cppvsdbg;
return resolve(newConfig);
Expand Down

0 comments on commit e466cac

Please sign in to comment.