Skip to content

Commit 0880d19

Browse files
committed
Special case cursor block blink to not use important
Fixes #4987
1 parent 7b76ca7 commit 0880d19

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/browser/renderer/dom/DomRenderer.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ export class DomRenderer extends Disposable implements IRenderer {
224224
` background-color: ${colors.cursor.css};` +
225225
` color: ${colors.cursorAccent.css};` +
226226
`}` +
227+
// !important helps fix an issue where the cursor will not render on top of the selection,
228+
// however it's very hard to fix this issue and retain the blink animation without the use of
229+
// !important. So this edge case fails when cursor blink is on.
230+
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${RowCss.CURSOR_CLASS}.${RowCss.CURSOR_STYLE_BLOCK_CLASS}:not(${RowCss.CURSOR_BLINK_CLASS}) {` +
231+
` background-color: ${colors.cursor.css} !important;` +
232+
` color: ${colors.cursorAccent.css} !important;` +
233+
`}` +
227234
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${RowCss.CURSOR_CLASS}.${RowCss.CURSOR_STYLE_OUTLINE_CLASS} {` +
228235
` outline: 1px solid ${colors.cursor.css};` +
229236
` outline-offset: -1px;` +

test/playwright/SharedRendererTests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { IImage32, decodePng } from '@lunapaint/png-codec';
77
import { LocatorScreenshotOptions, test } from '@playwright/test';
88
import { ITheme } from '@xterm/xterm';
9-
import { ITestContext, MaybeAsync, openTerminal, pollFor, pollForApproximate, timeout } from './TestUtils';
9+
import { ITestContext, MaybeAsync, openTerminal, pollFor, pollForApproximate } from './TestUtils';
1010

1111
export interface ISharedRendererTestContext {
1212
value: ITestContext;

0 commit comments

Comments
 (0)