@@ -183,14 +183,23 @@ export class DomRenderer extends Disposable implements IRenderer {
183183 ` font-style: italic;` +
184184 `}` ;
185185 // Blink animation
186+ const blinkAnimationUnderlineId = `blink_underline_${ this . _terminalClass } ` ;
187+ const blinkAnimationBarId = `blink_bar_${ this . _terminalClass } ` ;
188+ const blinkAnimationBlockId = `blink_block_${ this . _terminalClass } ` ;
186189 styles +=
187- `@keyframes blink_box_shadow` + `_` + this . _terminalClass + ` {` +
190+ `@keyframes ${ blinkAnimationUnderlineId } {` +
188191 ` 50% {` +
189192 ` border-bottom-style: hidden;` +
190193 ` }` +
191194 `}` ;
192195 styles +=
193- `@keyframes blink_block` + `_` + this . _terminalClass + ` {` +
196+ `@keyframes ${ blinkAnimationBarId } {` +
197+ ` 50% {` +
198+ ` box-shadow: none;` +
199+ ` }` +
200+ `}` ;
201+ styles +=
202+ `@keyframes ${ blinkAnimationBlockId } {` +
194203 ` 0% {` +
195204 ` background-color: ${ colors . cursor . css } ;` +
196205 ` color: ${ colors . cursorAccent . css } ;` +
@@ -202,13 +211,23 @@ export class DomRenderer extends Disposable implements IRenderer {
202211 `}` ;
203212 // Cursor
204213 styles +=
205- `${ this . _terminalSelector } .${ ROW_CONTAINER_CLASS } .${ FOCUS_CLASS } .${ RowCss . CURSOR_CLASS } .${ RowCss . CURSOR_BLINK_CLASS } :not(.${ RowCss . CURSOR_STYLE_BLOCK_CLASS } ) {` +
206- ` animation: blink_box_shadow` + `_` + this . _terminalClass + ` 1s step-end infinite;` +
214+ `${ this . _terminalSelector } .${ ROW_CONTAINER_CLASS } .${ FOCUS_CLASS } .${ RowCss . CURSOR_CLASS } .${ RowCss . CURSOR_BLINK_CLASS } .${ RowCss . CURSOR_STYLE_UNDERLINE_CLASS } {` +
215+ ` animation: ${ blinkAnimationUnderlineId } 1s step-end infinite;` +
216+ `}` +
217+ `${ this . _terminalSelector } .${ ROW_CONTAINER_CLASS } .${ FOCUS_CLASS } .${ RowCss . CURSOR_CLASS } .${ RowCss . CURSOR_BLINK_CLASS } .${ RowCss . CURSOR_STYLE_BAR_CLASS } {` +
218+ ` animation: ${ blinkAnimationBarId } 1s step-end infinite;` +
207219 `}` +
208220 `${ this . _terminalSelector } .${ ROW_CONTAINER_CLASS } .${ FOCUS_CLASS } .${ RowCss . CURSOR_CLASS } .${ RowCss . CURSOR_BLINK_CLASS } .${ RowCss . CURSOR_STYLE_BLOCK_CLASS } {` +
209- ` animation: blink_block` + `_` + this . _terminalClass + ` 1s step-end infinite;` +
221+ ` animation: ${ blinkAnimationBlockId } 1s step-end infinite;` +
210222 `}` +
223+ // !important helps fix an issue where the cursor will not render on top of the selection,
224+ // however it's very hard to fix this issue and retain the blink animation without the use of
225+ // !important. So this edge case fails when cursor blink is on.
211226 `${ this . _terminalSelector } .${ ROW_CONTAINER_CLASS } .${ RowCss . CURSOR_CLASS } .${ RowCss . CURSOR_STYLE_BLOCK_CLASS } {` +
227+ ` background-color: ${ colors . cursor . css } ;` +
228+ ` color: ${ colors . cursorAccent . css } ;` +
229+ `}` +
230+ `${ this . _terminalSelector } .${ ROW_CONTAINER_CLASS } .${ RowCss . CURSOR_CLASS } .${ RowCss . CURSOR_STYLE_BLOCK_CLASS } :not(.${ RowCss . CURSOR_BLINK_CLASS } ) {` +
212231 ` background-color: ${ colors . cursor . css } !important;` +
213232 ` color: ${ colors . cursorAccent . css } !important;` +
214233 `}` +
0 commit comments