Merge pull request #276116 from microsoft/tyriar/276071_externalterm

Remove in operator from externalTerminal
This commit is contained in:
Daniel Imms
2025-11-07 08:55:00 -08:00
committed by GitHub
2 changed files with 3 additions and 4 deletions

View File

@@ -239,7 +239,6 @@ export default tseslint.config(
'src/vs/platform/contextkey/browser/contextKeyService.ts',
'src/vs/platform/contextkey/test/common/scanner.test.ts',
'src/vs/platform/dataChannel/browser/forwardingTelemetryService.ts',
'src/vs/platform/externalTerminal/node/externalTerminalService.ts',
'src/vs/platform/hover/browser/hoverService.ts',
'src/vs/platform/hover/browser/hoverWidget.ts',
'src/vs/platform/instantiation/common/instantiationService.ts',

View File

@@ -75,7 +75,7 @@ export class WindowsExternalTerminalService extends ExternalTerminalService impl
}
public async runInTerminal(title: string, dir: string, args: string[], envVars: ITerminalEnvironment, settings: IExternalTerminalSettings): Promise<number | undefined> {
const exec = 'windowsExec' in settings && settings.windowsExec ? settings.windowsExec : WindowsExternalTerminalService.getDefaultTerminalWindows();
const exec = settings.windowsExec ?? WindowsExternalTerminalService.getDefaultTerminalWindows();
const wt = await WindowsExternalTerminalService.getWtExePath();
return new Promise<number | undefined>((resolve, reject) => {
@@ -348,8 +348,8 @@ function getSanitizedEnvironment(process: NodeJS.Process) {
* tries to turn OS errors into more meaningful error messages
*/
function improveError(err: Error & { errno?: string; path?: string }): Error {
if ('errno' in err && err['errno'] === 'ENOENT' && 'path' in err && typeof err['path'] === 'string') {
return new Error(nls.localize('ext.term.app.not.found', "can't find terminal application '{0}'", err['path']));
if (err.errno === 'ENOENT' && err.path) {
return new Error(nls.localize('ext.term.app.not.found', "can't find terminal application '{0}'", err.path));
}
return err;
}