From 87f2b7682fba16cab3922308a42fcf1000c5a877 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 5 Aug 2019 17:25:51 +0200 Subject: [PATCH] :polish: prefer to open file in same window if triggered from integrated terminal --- src/vs/code/electron-main/windows.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 +}