Fix frosted glass persistence (#11083)

This commit is contained in:
Utkarsh Adhran
2026-05-07 23:04:15 +02:00
committed by GitHub
parent ff81afb7fb
commit 0e9c570b13
3 changed files with 29 additions and 7 deletions
@@ -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"'
)
@@ -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,
}
+24 -2
View File
@@ -1,13 +1,21 @@
import { TerminalColorScheme } from './api/interfaces'
import { ConfigService, ThemesService } from 'tabby-core'
function getActiveTerminalTheme (
themes: ThemesService,
): { appTheme: ReturnType<ThemesService['findCurrentTheme']>, 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
}