+2
-2
@@ -16,7 +16,7 @@ if ('WebAssembly' in window) {
|
|||||||
ImageAddon = imageAddon.ImageAddon;
|
ImageAddon = imageAddon.ImageAddon;
|
||||||
}
|
}
|
||||||
|
|
||||||
import { Terminal, ITerminalOptions, type IDisposable } from '@xterm/xterm';
|
import { Terminal, ITerminalOptions, type IDisposable, type ITheme } from '@xterm/xterm';
|
||||||
import { AttachAddon } from '@xterm/addon-attach';
|
import { AttachAddon } from '@xterm/addon-attach';
|
||||||
import { ClipboardAddon } from '@xterm/addon-clipboard';
|
import { ClipboardAddon } from '@xterm/addon-clipboard';
|
||||||
import { FitAddon } from '@xterm/addon-fit';
|
import { FitAddon } from '@xterm/addon-fit';
|
||||||
@@ -131,7 +131,7 @@ const xtermjsTheme = {
|
|||||||
brightCyan: '#72F0FF',
|
brightCyan: '#72F0FF',
|
||||||
white: '#F8F8F8',
|
white: '#F8F8F8',
|
||||||
brightWhite: '#FFFFFF'
|
brightWhite: '#FFFFFF'
|
||||||
};
|
} satisfies ITheme;
|
||||||
function setPadding(): void {
|
function setPadding(): void {
|
||||||
term.element.style.padding = parseInt(paddingElement.value, 10).toString() + 'px';
|
term.element.style.padding = parseInt(paddingElement.value, 10).toString() + 'px';
|
||||||
addons.fit.instance.fit();
|
addons.fit.instance.fit();
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export class ThemeService extends Disposable implements IThemeService {
|
|||||||
const colors = this._colors;
|
const colors = this._colors;
|
||||||
colors.foreground = parseColor(theme.foreground, DEFAULT_FOREGROUND);
|
colors.foreground = parseColor(theme.foreground, DEFAULT_FOREGROUND);
|
||||||
colors.background = parseColor(theme.background, DEFAULT_BACKGROUND);
|
colors.background = parseColor(theme.background, DEFAULT_BACKGROUND);
|
||||||
colors.cursor = parseColor(theme.cursor, DEFAULT_CURSOR);
|
colors.cursor = color.blend(colors.background, parseColor(theme.cursor, DEFAULT_CURSOR));
|
||||||
colors.cursorAccent = parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT);
|
colors.cursorAccent = parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT);
|
||||||
colors.selectionBackgroundTransparent = parseColor(theme.selectionBackground, DEFAULT_SELECTION);
|
colors.selectionBackgroundTransparent = parseColor(theme.selectionBackground, DEFAULT_SELECTION);
|
||||||
colors.selectionBackgroundOpaque = color.blend(colors.background, colors.selectionBackgroundTransparent);
|
colors.selectionBackgroundOpaque = color.blend(colors.background, colors.selectionBackgroundTransparent);
|
||||||
|
|||||||
@@ -1248,6 +1248,14 @@ export function injectSharedRendererTests(ctx: ISharedRendererTestContext): void
|
|||||||
await ctx.value.proxy.scrollLines(-2);
|
await ctx.value.proxy.scrollLines(-2);
|
||||||
await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [0, 0, 0, 255]);
|
await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [0, 0, 0, 255]);
|
||||||
});
|
});
|
||||||
|
test('#5241 cursor with alpha should blend color with background color', async () => {
|
||||||
|
const theme: ITheme = {
|
||||||
|
cursor: '#FF000080'
|
||||||
|
};
|
||||||
|
await ctx.value.page.evaluate(`window.term.options.theme = ${JSON.stringify(theme)};`);
|
||||||
|
await ctx.value.proxy.focus();
|
||||||
|
await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [128, 0, 0, 255]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user