diff --git a/packages/plugin-ext/src/plugin/terminal-ext.ts b/packages/plugin-ext/src/plugin/terminal-ext.ts index 8f8dc0fa4bf71..98ea3fb488836 100644 --- a/packages/plugin-ext/src/plugin/terminal-ext.ts +++ b/packages/plugin-ext/src/plugin/terminal-ext.ts @@ -46,7 +46,7 @@ export function getIconUris(iconPath: theia.TerminalOptions['iconPath']): Monaco export function getIconClass( options: theia.TerminalOptions | theia.ExtensionTerminalOptions, sharedStyle: PluginSharedStyle, disposables: DisposableCollection -): string | { icon: string, color: string } | undefined { +): string | ThemeIcon | undefined { const iconUriOrCodicon = getIconUris(options.iconPath); const iconColor = MonacoThemeColor.isThemeColor(options.color) ? options.color : undefined; let iconClass; @@ -61,7 +61,7 @@ export function getIconClass( } else { iconClass = (MonacoThemeIcon.asClassName({ id: 'terminal' })); } - return iconColor ? { icon: iconClass, color: iconColor.id } : iconClass; + return iconColor ? { id: iconClass, color: { id: iconColor.id } } : iconClass; } /** diff --git a/packages/terminal/src/browser/base/terminal-widget.ts b/packages/terminal/src/browser/base/terminal-widget.ts index 4a3631a066c84..7c9443f94de7f 100644 --- a/packages/terminal/src/browser/base/terminal-widget.ts +++ b/packages/terminal/src/browser/base/terminal-widget.ts @@ -16,11 +16,12 @@ import { Event, ViewColumn } from '@theia/core'; import { BaseWidget } from '@theia/core/lib/browser'; +import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string'; +import { ThemeIcon } from '@theia/core/lib/common/theme'; import { CommandLineOptions } from '@theia/process/lib/common/shell-command-builder'; import { TerminalSearchWidget } from '../search/terminal-search-widget'; import { TerminalProcessInfo, TerminalExitReason } from '../../common/base-terminal-protocol'; import URI from '@theia/core/lib/common/uri'; -import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string'; export interface TerminalDimensions { cols: number; @@ -179,11 +180,6 @@ export abstract class TerminalWidget extends BaseWidget { abstract waitOnExit(waitOnExit?: boolean | string): void; } -export interface TerminalIcon { - icon: string; - color?: string; -} - /** * Terminal widget options. */ @@ -198,7 +194,7 @@ export interface TerminalWidgetOptions { /** * icon class with or without color modifier */ - readonly iconClass?: string | TerminalIcon; + readonly iconClass?: string | ThemeIcon; /** * Path to the executable shell. For example: `/bin/bash`, `bash`, `sh`. diff --git a/packages/terminal/src/browser/terminal-widget-impl.ts b/packages/terminal/src/browser/terminal-widget-impl.ts index c8705f990c42c..01cec362603ac 100644 --- a/packages/terminal/src/browser/terminal-widget-impl.ts +++ b/packages/terminal/src/browser/terminal-widget-impl.ts @@ -170,10 +170,10 @@ export class TerminalWidgetImpl extends TerminalWidget implements StatefulWidget this.title.iconClass = iconClass; } else { const iconClasses: string[] = []; - iconClasses.push(iconClass.icon); + iconClasses.push(iconClass.id); // TODO: Build different handling for URI icons. - if (iconClass.color && this.isTerminalAnsiColor(iconClass.color)) { - const color = this.getCodiconColor(iconClass.color); + if (iconClass.color && this.isTerminalAnsiColor(iconClass.color.id)) { + const color = this.getCodiconColor(iconClass.color.id); iconClasses.push(color ? color : ''); } this.title.iconClass = iconClasses.join(' ');