mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 01:00:29 -04:00
Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c (#8525)
* Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c * remove files we don't want * fix hygiene * update distro * update distro * fix hygiene * fix strict nulls * distro * distro * fix tests * fix tests * add another edit * fix viewlet icon * fix azure dialog * fix some padding * fix more padding issues
This commit is contained in:
@@ -16,7 +16,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { TerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminalInstance';
|
||||
import { ITerminalService, ITerminalInstance, ITerminalTab } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { ITerminalService, ITerminalInstance, ITerminalTab, TerminalShellType, WindowsShellType } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||
import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminalConfigHelper';
|
||||
import { IQuickInputService, IQuickPickItem, IPickOptions } from 'vs/platform/quickinput/common/quickInput';
|
||||
@@ -504,7 +504,7 @@ export class TerminalService implements ITerminalService {
|
||||
});
|
||||
}
|
||||
|
||||
public preparePathForTerminalAsync(originalPath: string, executable: string, title: string): Promise<string> {
|
||||
public preparePathForTerminalAsync(originalPath: string, executable: string, title: string, shellType: TerminalShellType): Promise<string> {
|
||||
return new Promise<string>(c => {
|
||||
if (!executable) {
|
||||
c(originalPath);
|
||||
@@ -527,18 +527,41 @@ export class TerminalService implements ITerminalService {
|
||||
if (isWindows) {
|
||||
// 17063 is the build number where wsl path was introduced.
|
||||
// Update Windows uriPath to be executed in WSL.
|
||||
const lowerExecutable = executable.toLowerCase();
|
||||
if (this._terminalNativeService.getWindowsBuildNumber() >= 17063 &&
|
||||
(lowerExecutable.indexOf('wsl') !== -1 || (lowerExecutable.indexOf('bash.exe') !== -1 && lowerExecutable.toLowerCase().indexOf('git') === -1))) {
|
||||
c(this._terminalNativeService.getWslPath(originalPath));
|
||||
return;
|
||||
} else if (hasSpace) {
|
||||
c('"' + originalPath + '"');
|
||||
if (shellType !== undefined) {
|
||||
if (shellType === WindowsShellType.GitBash) {
|
||||
c(originalPath.replace(/\\/g, '/'));
|
||||
return;
|
||||
}
|
||||
else if (shellType === WindowsShellType.Wsl) {
|
||||
if (this._terminalNativeService.getWindowsBuildNumber() >= 17063) {
|
||||
c(this._terminalNativeService.getWslPath(originalPath));
|
||||
} else {
|
||||
c(originalPath.replace(/\\/g, '/'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasSpace) {
|
||||
c('"' + originalPath + '"');
|
||||
} else {
|
||||
c(originalPath);
|
||||
}
|
||||
} else {
|
||||
c(originalPath);
|
||||
const lowerExecutable = executable.toLowerCase();
|
||||
if (this._terminalNativeService.getWindowsBuildNumber() >= 17063 &&
|
||||
(lowerExecutable.indexOf('wsl') !== -1 || (lowerExecutable.indexOf('bash.exe') !== -1 && lowerExecutable.toLowerCase().indexOf('git') === -1))) {
|
||||
c(this._terminalNativeService.getWslPath(originalPath));
|
||||
return;
|
||||
} else if (hasSpace) {
|
||||
c('"' + originalPath + '"');
|
||||
} else {
|
||||
c(originalPath);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c(escapeNonWindowsPath(originalPath));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user