Merge from vscode 70dc55955d586ebd427658b43cdb344f2047f9c2 (#6789)

This commit is contained in:
Anthony Dresser
2019-08-16 21:47:46 -07:00
committed by GitHub
parent fb26126bcb
commit 41d8663b09
79 changed files with 1815 additions and 572 deletions

View File

@@ -11,7 +11,7 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag
import { ITerminalConfiguration, ITerminalFont, IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, TERMINAL_CONFIG_SECTION, DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, MINIMUM_LETTER_SPACING, LinuxDistro, IShellLaunchConfig } from 'vs/workbench/contrib/terminal/common/terminal';
import Severity from 'vs/base/common/severity';
import { Terminal as XTermTerminal } from 'xterm';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { INotificationService, NeverShowAgainScope } from 'vs/platform/notification/common/notification';
import { IBrowserTerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminal';
import { Emitter, Event } from 'vs/base/common/event';
import { basename } from 'vs/base/common/path';
@@ -254,7 +254,6 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
return r;
}
private readonly NO_RECOMMENDATIONS_KEY = 'terminalConfigHelper/launchRecommendationsIgnore';
private recommendationsShown = false;
public async showRecommendations(shellLaunchConfig: IShellLaunchConfig): Promise<void> {
@@ -264,10 +263,6 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
this.recommendationsShown = true;
if (platform.isWindows && shellLaunchConfig.executable && basename(shellLaunchConfig.executable).toLowerCase() === 'wsl.exe') {
if (this._storageService.getBoolean(this.NO_RECOMMENDATIONS_KEY, StorageScope.WORKSPACE, false)) {
return;
}
if (! await this.isExtensionInstalled('ms-vscode-remote.remote-wsl')) {
this._notificationService.prompt(
Severity.Info,
@@ -276,16 +271,10 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
"Check out the 'Visual Studio Code Remote - WSL' extension for a great development experience in WSL. Click [here]({0}) to learn more.",
'https://go.microsoft.com/fwlink/?linkid=2097212'
),
[
{
label: nls.localize('doNotShowAgain', "Don't Show Again"),
run: () => {
this._storageService.store(this.NO_RECOMMENDATIONS_KEY, true, StorageScope.WORKSPACE);
}
}
],
[],
{
sticky: true
sticky: true,
neverShowAgain: { id: 'terminalConfigHelper/launchRecommendationsIgnore', scope: NeverShowAgainScope.WORKSPACE }
}
);
}

View File

@@ -144,18 +144,20 @@ export function getCwd(
try {
customCwd = configurationResolverService.resolve(lastActiveWorkspace, customCwd);
} catch (e) {
// There was an issue resolving a variable, just use the unresolved customCwd which
// which will fail, and log the error in the console.
// There was an issue resolving a variable, log the error in the console and
// fallback to the default.
if (logService) {
logService.error('Could not resolve terminal.integrated.cwd', e);
}
return customCwd;
customCwd = undefined;
}
}
if (path.isAbsolute(customCwd)) {
cwd = customCwd;
} else if (root) {
cwd = path.join(root.fsPath, customCwd);
if (customCwd) {
if (path.isAbsolute(customCwd)) {
cwd = customCwd;
} else if (root) {
cwd = path.join(root.fsPath, customCwd);
}
}
}
@@ -208,33 +210,33 @@ export function getDefaultShell(
if (!maybeExecutable) {
maybeExecutable = getShellSetting(fetchSetting, isWorkspaceShellAllowed, 'shell', platformOverride);
}
maybeExecutable = maybeExecutable || defaultShell;
let executable: string = maybeExecutable || defaultShell;
// Change Sysnative to System32 if the OS is Windows but NOT WoW64. It's
// safe to assume that this was used by accident as Sysnative does not
// exist and will break the terminal in non-WoW64 environments.
if ((platformOverride === platform.Platform.Windows) && !isWoW64 && windir) {
const sysnativePath = path.join(windir, 'Sysnative').replace(/\//g, '\\').toLowerCase();
if (maybeExecutable && maybeExecutable.toLowerCase().indexOf(sysnativePath) === 0) {
maybeExecutable = path.join(windir, 'System32', maybeExecutable.substr(sysnativePath.length + 1));
if (executable && executable.toLowerCase().indexOf(sysnativePath) === 0) {
executable = path.join(windir, 'System32', executable.substr(sysnativePath.length + 1));
}
}
// Convert / to \ on Windows for convenience
if (maybeExecutable && platformOverride === platform.Platform.Windows) {
maybeExecutable = maybeExecutable.replace(/\//g, '\\');
if (executable && platformOverride === platform.Platform.Windows) {
executable = executable.replace(/\//g, '\\');
}
if (configurationResolverService) {
try {
maybeExecutable = configurationResolverService.resolve(lastActiveWorkspace, maybeExecutable);
executable = configurationResolverService.resolve(lastActiveWorkspace, executable);
} catch (e) {
logService.error(`Could not resolve shell`, e);
maybeExecutable = maybeExecutable;
executable = executable;
}
}
return maybeExecutable;
return executable;
}
export function getDefaultShellArgs(