mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Merge pull request #156807 from microsoft/tyriar/156806
Support default icon/color in folder scope
This commit is contained in:
commit
59cd6e48d8
|
@ -116,8 +116,8 @@ export abstract class BaseTerminalProfileResolverService implements ITerminalPro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getDefaultIcon(): TerminalIcon & ThemeIcon {
|
getDefaultIcon(resource?: URI): TerminalIcon & ThemeIcon {
|
||||||
return this._iconRegistry.getIcon(this._configurationService.getValue(TerminalSettingId.TabsDefaultIcon)) || Codicon.terminal;
|
return this._iconRegistry.getIcon(this._configurationService.getValue(TerminalSettingId.TabsDefaultIcon, { resource })) || Codicon.terminal;
|
||||||
}
|
}
|
||||||
|
|
||||||
async resolveShellLaunchConfig(shellLaunchConfig: IShellLaunchConfig, options: IShellLaunchConfigResolveOptions): Promise<void> {
|
async resolveShellLaunchConfig(shellLaunchConfig: IShellLaunchConfig, options: IShellLaunchConfigResolveOptions): Promise<void> {
|
||||||
|
@ -145,9 +145,10 @@ export abstract class BaseTerminalProfileResolverService implements ITerminalPro
|
||||||
|
|
||||||
// Verify the icon is valid, and fallback correctly to the generic terminal id if there is
|
// Verify the icon is valid, and fallback correctly to the generic terminal id if there is
|
||||||
// an issue
|
// an issue
|
||||||
|
const resource = shellLaunchConfig === undefined || typeof shellLaunchConfig.cwd === 'string' ? undefined : shellLaunchConfig.cwd;
|
||||||
shellLaunchConfig.icon = this._getCustomIcon(shellLaunchConfig.icon)
|
shellLaunchConfig.icon = this._getCustomIcon(shellLaunchConfig.icon)
|
||||||
|| this._getCustomIcon(resolvedProfile.icon)
|
|| this._getCustomIcon(resolvedProfile.icon)
|
||||||
|| this.getDefaultIcon();
|
|| this.getDefaultIcon(resource);
|
||||||
|
|
||||||
// Override the name if specified
|
// Override the name if specified
|
||||||
if (resolvedProfile.overrideName) {
|
if (resolvedProfile.overrideName) {
|
||||||
|
@ -157,7 +158,7 @@ export abstract class BaseTerminalProfileResolverService implements ITerminalPro
|
||||||
// Apply the color
|
// Apply the color
|
||||||
shellLaunchConfig.color = shellLaunchConfig.color
|
shellLaunchConfig.color = shellLaunchConfig.color
|
||||||
|| resolvedProfile.color
|
|| resolvedProfile.color
|
||||||
|| this._configurationService.getValue(TerminalSettingId.TabsDefaultColor);
|
|| this._configurationService.getValue(TerminalSettingId.TabsDefaultColor, { resource });
|
||||||
|
|
||||||
// Resolve useShellEnvironment based on the setting if it's not set
|
// Resolve useShellEnvironment based on the setting if it's not set
|
||||||
if (shellLaunchConfig.useShellEnvironment === undefined) {
|
if (shellLaunchConfig.useShellEnvironment === undefined) {
|
||||||
|
|
|
@ -42,12 +42,14 @@ const terminalConfiguration: IConfigurationNode = {
|
||||||
},
|
},
|
||||||
[TerminalSettingId.TabsDefaultColor]: {
|
[TerminalSettingId.TabsDefaultColor]: {
|
||||||
description: localize('terminal.integrated.tabs.defaultColor', "A theme color ID to associate with terminal icons by default."),
|
description: localize('terminal.integrated.tabs.defaultColor', "A theme color ID to associate with terminal icons by default."),
|
||||||
...terminalColorSchema
|
...terminalColorSchema,
|
||||||
|
scope: ConfigurationScope.RESOURCE
|
||||||
},
|
},
|
||||||
[TerminalSettingId.TabsDefaultIcon]: {
|
[TerminalSettingId.TabsDefaultIcon]: {
|
||||||
description: localize('terminal.integrated.tabs.defaultIcon', "A codicon ID to associate with terminal icons by default."),
|
description: localize('terminal.integrated.tabs.defaultIcon', "A codicon ID to associate with terminal icons by default."),
|
||||||
...terminalIconSchema,
|
...terminalIconSchema,
|
||||||
default: Codicon.terminal.id,
|
default: Codicon.terminal.id,
|
||||||
|
scope: ConfigurationScope.RESOURCE
|
||||||
},
|
},
|
||||||
[TerminalSettingId.TabsEnabled]: {
|
[TerminalSettingId.TabsEnabled]: {
|
||||||
description: localize('terminal.integrated.tabs.enabled', 'Controls whether terminal tabs display as a list to the side of the terminal. When this is disabled a dropdown will display instead.'),
|
description: localize('terminal.integrated.tabs.enabled', 'Controls whether terminal tabs display as a list to the side of the terminal. When this is disabled a dropdown will display instead.'),
|
||||||
|
|
Loading…
Reference in a new issue