:polish: prefer to open file in same window if triggered from integrated terminal

This commit is contained in:
Benjamin Pasero
2019-08-05 17:25:51 +02:00
parent b41d71722a
commit 87f2b7682f

View File

@@ -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;
}
}