Fix OSC 11 background color reporting (#11074)

Co-authored-by: Eugene <inbox@null.page>
This commit is contained in:
Utkarsh Adhran
2026-05-07 23:46:23 +02:00
committed by GitHub
co-authored by Eugene
parent 2e85f8d23e
commit 78a56326ac
12 changed files with 29 additions and 32 deletions
@@ -1,4 +1,4 @@
import { TerminalColorScheme } from './interfaces'
import { TerminalColorScheme } from 'tabby-core'
/**
* Extend to add more terminal color schemes
+1 -12
View File
@@ -1,21 +1,10 @@
import { ConnectableProfile, Profile } from 'tabby-core'
import { ConnectableProfile, Profile, TerminalColorScheme } from 'tabby-core'
export interface ResizeEvent {
columns: number
rows: number
}
export interface TerminalColorScheme {
name: string
foreground: string
background: string
cursor: string
colors: string[]
selection?: string
selectionForeground?: string
cursorAccent?: string
}
export interface BaseTerminalProfile extends Profile {
terminalColorScheme: TerminalColorScheme | null
}
+1 -1
View File
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'
import { TerminalColorScheme } from './api/interfaces'
import { TerminalColorSchemeProvider } from './api/colorSchemeProvider'
import { TerminalColorScheme } from 'tabby-core'
@Injectable({ providedIn: 'root' })
export class DefaultColorSchemes extends TerminalColorSchemeProvider {
@@ -1,6 +1,5 @@
import { Component, Input, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'
import { BaseComponent, ConfigService, getCSSFontFamily } from 'tabby-core'
import { TerminalColorScheme } from '../api/interfaces'
import { BaseComponent, ConfigService, getCSSFontFamily, TerminalColorScheme } from 'tabby-core'
/** @hidden */
@Component({
@@ -2,9 +2,8 @@
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'
import { Component, Inject, Input, ChangeDetectionStrategy, ChangeDetectorRef, HostBinding, Output, EventEmitter } from '@angular/core'
import { ConfigService } from 'tabby-core'
import { ConfigService, TerminalColorScheme } from 'tabby-core'
import { TerminalColorSchemeProvider } from '../api/colorSchemeProvider'
import { TerminalColorScheme } from '../api/interfaces'
_('Search color schemes')
@@ -3,9 +3,8 @@ import deepEqual from 'deep-equal'
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'
import { Component, Inject, Input, ChangeDetectionStrategy, ChangeDetectorRef, HostBinding } from '@angular/core'
import { ConfigService, PlatformService, TranslateService } from 'tabby-core'
import { ConfigService, PlatformService, TerminalColorScheme, TranslateService } from 'tabby-core'
import { TerminalColorSchemeProvider } from '../api/colorSchemeProvider'
import { TerminalColorScheme } from '../api/interfaces'
_('Search color schemes')
@@ -1,7 +1,7 @@
import deepEqual from 'deep-equal'
import { BehaviorSubject, filter, firstValueFrom, takeUntil } from 'rxjs'
import { Injector } from '@angular/core'
import { ConfigService, getCSSFontFamily, getWindows10Build, HostAppService, HotkeysService, Platform, PlatformService, ThemesService } from 'tabby-core'
import { ConfigService, getCSSFontFamily, getWindows10Build, HostAppService, HotkeysService, Platform, PlatformService, TerminalColorScheme, ThemesService } from 'tabby-core'
import { Frontend, SearchOptions, SearchState } from './frontend'
import { Terminal, ITheme } from '@xterm/xterm'
import { FitAddon } from '@xterm/addon-fit'
@@ -12,7 +12,7 @@ import { Unicode11Addon } from '@xterm/addon-unicode11'
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 { BaseTerminalProfile } from '../api/interfaces'
import { getXtermBackgroundColor } from '../helpers'
import { generatePalette } from '../generatePalette'
import './xterm.css'
@@ -455,7 +455,7 @@ export class XTermFrontend extends Frontend {
}
private configureColors (scheme: TerminalColorScheme | null): void {
const appColorScheme = this.themes._getActiveColorScheme() as TerminalColorScheme
const appColorScheme = this.themes._getActiveColorScheme()
scheme = scheme ?? appColorScheme
+3 -4
View File
@@ -1,11 +1,10 @@
import { TerminalColorScheme } from './api/interfaces'
import { ConfigService, ThemesService } from 'tabby-core'
import { ConfigService, ThemesService, Theme, TerminalColorScheme } from 'tabby-core'
function getActiveTerminalTheme (
themes: ThemesService,
): { appTheme: ReturnType<ThemesService['findCurrentTheme']>, appColorScheme: TerminalColorScheme } {
): { appTheme: Theme, appColorScheme: TerminalColorScheme } {
const appTheme = themes.findCurrentTheme()
const appColorScheme = themes._getActiveColorScheme() as TerminalColorScheme
const appColorScheme = themes._getActiveColorScheme()
return { appTheme, appColorScheme }
}
+1
View File
@@ -105,3 +105,4 @@ export * from './api/middleware'
export * from './session'
export { LoginScriptsSettingsComponent, StreamProcessingSettingsComponent }
export { MultifocusService } from './services/multifocus.service'
export { TerminalColorScheme } from 'tabby-core' // was previously defined in this plugin