Skip to content

Commit 68dddd8

Browse files
committed
reinterpret internalConsole to be integratedTerminal
1 parent da02611 commit 68dddd8

2 files changed

Lines changed: 4 additions & 29 deletions

File tree

Extension/src/Debugger/configurations.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function createLaunchString(name: string, type: string, executable: string): str
9797
"stopAtEntry": false,
9898
"cwd": "$\{fileDirname\}",
9999
"environment": [],
100-
${ type === "cppdbg" ? `"externalConsole": false` : `"console": "integratedTerminal"` }
100+
${type === "cppdbg" ? `"externalConsole": false` : `"console": "internalConsole"`}
101101
`;
102102
}
103103

@@ -164,7 +164,7 @@ export class MIConfigurations extends Configuration {
164164
\t${indentJsonString(createLaunchString(name, this.miDebugger, this.executable))},
165165
\t"MIMode": "${this.MIMode}"{0}{1}
166166
}`, [this.miDebugger === "cppdbg" && os.platform() === "win32" ? `,${os.EOL}\t"miDebuggerPath": "/path/to/gdb"` : "",
167-
this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
167+
this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
168168

169169
return {
170170
"label": configPrefix + name,
@@ -182,7 +182,7 @@ export class MIConfigurations extends Configuration {
182182
\t${indentJsonString(createAttachString(name, this.miDebugger, this.executable))}
183183
\t"MIMode": "${this.MIMode}"{0}{1}
184184
}`, [this.miDebugger === "cppdbg" && os.platform() === "win32" ? `,${os.EOL}\t"miDebuggerPath": "/path/to/gdb"` : "",
185-
this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
185+
this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
186186

187187
return {
188188
"label": configPrefix + name,

Extension/src/Debugger/runWithoutDebuggingAdapter.ts

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,10 @@ export class RunWithoutDebuggingAdapter implements vscode.DebugAdapter {
8181

8282
this.sendResponse(request, {});
8383

84-
if (consoleMode === 'integratedTerminal') {
84+
if (consoleMode === 'integratedTerminal' || consoleMode === 'internalConsole') {
8585
await this.launchIntegratedTerminal(program, args, cwd, env);
8686
} else if (consoleMode === 'externalTerminal') {
8787
this.launchExternalTerminal(program, args, cwd, env);
88-
} else {
89-
this.launchInternalConsole(program, args, cwd, env);
9088
}
9189
}
9290

@@ -175,29 +173,6 @@ export class RunWithoutDebuggingAdapter implements vscode.DebugAdapter {
175173
vscode.window.showErrorMessage(message);
176174
}
177175

178-
/**
179-
* Spawn the process and forward stdout/stderr as DAP output events.
180-
*/
181-
private launchInternalConsole(program: string, args: string[], cwd: string | undefined, env: NodeJS.ProcessEnv) {
182-
this.childProcess = cp.spawn(program, args, { cwd, env });
183-
184-
this.childProcess.stdout?.on('data', (data: Buffer) => {
185-
this.sendEvent('output', { category: 'stdout', output: data.toString() });
186-
});
187-
this.childProcess.stderr?.on('data', (data: Buffer) => {
188-
this.sendEvent('output', { category: 'stderr', output: data.toString() });
189-
});
190-
this.childProcess.on('error', (err: Error) => {
191-
this.sendEvent('output', { category: 'stderr', output: `${err.message}\n` });
192-
this.sendEvent('exited', { exitCode: 1 });
193-
this.sendEvent('terminated');
194-
});
195-
this.childProcess.on('exit', (code: number | null) => {
196-
this.sendEvent('exited', { exitCode: code ?? 0 });
197-
this.sendEvent('terminated');
198-
});
199-
}
200-
201176
private escapeQuotes(arg: string): string {
202177
return arg.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
203178
}

0 commit comments

Comments
 (0)