Skip to content

Commit 318f3dc

Browse files
authored
Merge pull request #5262 from Tyriar/tyriar/5241_2
Blend cursorAccent with background too
2 parents 5018a07 + 18c9eb1 commit 318f3dc

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/browser/services/ThemeService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class ThemeService extends Disposable implements IThemeService {
8383
colors.foreground = parseColor(theme.foreground, DEFAULT_FOREGROUND);
8484
colors.background = parseColor(theme.background, DEFAULT_BACKGROUND);
8585
colors.cursor = color.blend(colors.background, parseColor(theme.cursor, DEFAULT_CURSOR));
86-
colors.cursorAccent = parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT);
86+
colors.cursorAccent = color.blend(colors.background, parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT));
8787
colors.selectionBackgroundTransparent = parseColor(theme.selectionBackground, DEFAULT_SELECTION);
8888
colors.selectionBackgroundOpaque = color.blend(colors.background, colors.selectionBackgroundTransparent);
8989
colors.selectionInactiveBackgroundTransparent = parseColor(theme.selectionInactiveBackground, colors.selectionBackgroundTransparent);

test/playwright/SharedRendererTests.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,16 @@ export function injectSharedRendererTests(ctx: ISharedRendererTestContext): void
12561256
await ctx.value.proxy.focus();
12571257
await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [128, 0, 0, 255]);
12581258
});
1259+
test('#5241 cursorAccent with alpha should blend color with background color', async () => {
1260+
const theme: ITheme = {
1261+
cursorAccent: '#FF000080'
1262+
};
1263+
await ctx.value.page.evaluate(`window.term.options.theme = ${JSON.stringify(theme)};`);
1264+
await ctx.value.proxy.focus();
1265+
await ctx.value.proxy.write('■');
1266+
await ctx.value.proxy.write('\x1b[1D');
1267+
await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [128, 0, 0, 255]);
1268+
});
12591269
});
12601270
}
12611271

0 commit comments

Comments
 (0)