diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 5e50acec4dc..c98f1958018 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -1149,9 +1149,10 @@ export class WindowsManager extends Disposable implements IWindowsMainService { } } - // Linux/Windows: by default we open files in the new window unless triggered via DIALOG or MENU context + // Linux/Windows: by default we open files in the new window unless triggered via DIALOG / MENU context + // or from the integrated terminal where we assume the user prefers to open in the current window else { - if (openConfig.context !== OpenContext.DIALOG && openConfig.context !== OpenContext.MENU) { + if (openConfig.context !== OpenContext.DIALOG && openConfig.context !== OpenContext.MENU && !(openConfig.userEnv && openConfig.userEnv['TERM_PROGRAM'] === 'vscode')) { openFilesInNewWindow = true; } } @@ -2116,4 +2117,4 @@ function resourceFromURIToOpen(u: IURIToOpen): URI { } return u.fileUri; -} \ No newline at end of file +}