diff --git a/tabby-settings/src/components/windowSettingsTab.component.pug b/tabby-settings/src/components/windowSettingsTab.component.pug index 62ac0075..8d4af5f1 100644 --- a/tabby-settings/src/components/windowSettingsTab.component.pug +++ b/tabby-settings/src/components/windowSettingsTab.component.pug @@ -40,7 +40,7 @@ h3.mb-3(translate) Window toggle( [(ngModel)]='config.store.appearance.vibrancy', - (ngModelChange)='saveConfiguration()' + (ngModelChange)='config.save()' ) .form-line(*ngIf='config.store.appearance.vibrancy && isFluentVibrancySupported && config.store.hacks.enableFluentBackground') @@ -51,7 +51,7 @@ h3.mb-3(translate) Window type='radio', name='vibracy', [(ngModel)]='config.store.appearance.vibrancyType', - (ngModelChange)='saveConfiguration()', + (ngModelChange)='config.save()', id='vibrancyTypeBlur', [value]='"blur"' ) @@ -63,7 +63,7 @@ h3.mb-3(translate) Window type='radio', name='vibracy', [(ngModel)]='config.store.appearance.vibrancyType', - (ngModelChange)='saveConfiguration()', + (ngModelChange)='config.save()', id='vibrancyTypeFluent', [value]='"fluent"' ) diff --git a/tabby-terminal/src/frontends/xtermFrontend.ts b/tabby-terminal/src/frontends/xtermFrontend.ts index 56345534..a568a96b 100644 --- a/tabby-terminal/src/frontends/xtermFrontend.ts +++ b/tabby-terminal/src/frontends/xtermFrontend.ts @@ -13,7 +13,7 @@ import { SerializeAddon } from '@xterm/addon-serialize' import { ImageAddon } from '@xterm/addon-image' import { CanvasAddon } from '@xterm/addon-canvas' import { BaseTerminalProfile, TerminalColorScheme } from '../api/interfaces' -import { getTerminalBackgroundColor } from '../helpers' +import { getXtermBackgroundColor } from '../helpers' import './xterm.css' const COLOR_NAMES = [ @@ -462,7 +462,7 @@ export class XTermFrontend extends Frontend { foreground: scheme.foreground, selectionBackground: scheme.selection ?? '#88888888', selectionForeground: scheme.selectionForeground ?? undefined, - background: getTerminalBackgroundColor(this.configService, this.themes, scheme) ?? '#00000000', + background: getXtermBackgroundColor(this.configService, this.themes, scheme), cursor: scheme.cursor, cursorAccent: scheme.cursorAccent, } diff --git a/tabby-terminal/src/helpers.ts b/tabby-terminal/src/helpers.ts index ebfd2553..8e1d5712 100644 --- a/tabby-terminal/src/helpers.ts +++ b/tabby-terminal/src/helpers.ts @@ -1,13 +1,21 @@ import { TerminalColorScheme } from './api/interfaces' import { ConfigService, ThemesService } from 'tabby-core' +function getActiveTerminalTheme ( + themes: ThemesService, +): { appTheme: ReturnType, appColorScheme: TerminalColorScheme } { + const appTheme = themes.findCurrentTheme() + const appColorScheme = themes._getActiveColorScheme() as TerminalColorScheme + + return { appTheme, appColorScheme } +} + export function getTerminalBackgroundColor ( config: ConfigService, themes: ThemesService, scheme: TerminalColorScheme | null, ): string|null { - const appTheme = themes.findCurrentTheme() - const appColorScheme = themes._getActiveColorScheme() as TerminalColorScheme + const { appTheme, appColorScheme } = getActiveTerminalTheme(themes) // Use non transparent background when: // - legacy theme and user choses colorScheme based BG @@ -19,3 +27,17 @@ export function getTerminalBackgroundColor ( return shouldUseCSBackground && scheme ? scheme.background : null } + +export function getXtermBackgroundColor ( + config: ConfigService, + themes: ThemesService, + scheme: TerminalColorScheme | null, +): string { + const configuredBackground = getTerminalBackgroundColor(config, themes, scheme) + if (configuredBackground) { + return configuredBackground + } + + const { appTheme, appColorScheme } = getActiveTerminalTheme(themes) + return appTheme.followsColorScheme ? appColorScheme.background : appTheme.terminalBackground +}