@@ -8,6 +8,7 @@ import { WidthCache } from 'browser/renderer/dom/WidthCache';
88import { INVERTED_DEFAULT_COLOR , RendererConstants } from 'browser/renderer/shared/Constants' ;
99import { createRenderDimensions } from 'browser/renderer/shared/RendererUtils' ;
1010import { createSelectionRenderModel } from 'browser/renderer/shared/SelectionRenderModel' ;
11+ import { TextBlinkStateManager } from 'browser/renderer/shared/TextBlinkStateManager' ;
1112import { IRenderDimensions , IRenderer , IRequestRedrawEvent , ISelectionRenderModel } from 'browser/renderer/shared/Types' ;
1213import { ICharSizeService , ICoreBrowserService , IThemeService } from 'browser/services/Services' ;
1314import { ILinkifier2 , ILinkifierEvent , ITerminal , ReadonlyColorSet } from 'browser/Types' ;
@@ -45,10 +46,12 @@ export class DomRenderer extends Disposable implements IRenderer {
4546 private _widthCache : WidthCache ;
4647 private _selectionRenderModel : ISelectionRenderModel = createSelectionRenderModel ( ) ;
4748 private _cursorBlinkStateManager : CursorBlinkStateManager ;
49+ private _textBlinkStateManager : TextBlinkStateManager ;
4850
4951 public dimensions : IRenderDimensions ;
5052
51- public readonly onRequestRedraw = this . _register ( new Emitter < IRequestRedrawEvent > ( ) ) . event ;
53+ private readonly _onRequestRedraw = this . _register ( new Emitter < IRequestRedrawEvent > ( ) ) ;
54+ public readonly onRequestRedraw = this . _onRequestRedraw . event ;
5255
5356 constructor (
5457 private readonly _terminal : ITerminal ,
@@ -95,6 +98,11 @@ export class DomRenderer extends Disposable implements IRenderer {
9598 this . _cursorBlinkStateManager = new CursorBlinkStateManager ( this . _rowContainer , this . _coreBrowserService ) ;
9699 this . _register ( addDisposableListener ( this . _document , 'mousedown' , ( ) => this . _cursorBlinkStateManager . restartBlinkAnimation ( ) ) ) ;
97100 this . _register ( toDisposable ( ( ) => this . _cursorBlinkStateManager . dispose ( ) ) ) ;
101+ this . _textBlinkStateManager = this . _register ( new TextBlinkStateManager (
102+ ( ) => this . _onRequestRedraw . fire ( { start : 0 , end : this . _bufferService . rows - 1 } ) ,
103+ this . _coreBrowserService ,
104+ this . _optionsService
105+ ) ) ;
98106
99107 this . _register ( toDisposable ( ( ) => {
100108 this . _element . classList . remove ( TERMINAL_CLASS_PREFIX + this . _terminalClass ) ;
@@ -193,6 +201,9 @@ export class DomRenderer extends Disposable implements IRenderer {
193201 `}` +
194202 `${ this . _terminalSelector } span.${ RowCss . ITALIC_CLASS } {` +
195203 ` font-style: italic;` +
204+ `}` +
205+ `${ this . _terminalSelector } span.${ RowCss . BLINK_HIDDEN_CLASS } {` +
206+ ` visibility: hidden;` +
196207 `}` ;
197208 // Blink animation
198209 const blinkAnimationUnderlineId = `blink_underline_${ this . _terminalClass } ` ;
@@ -476,6 +487,7 @@ export class DomRenderer extends Disposable implements IRenderer {
476487 cursorInactiveStyle ,
477488 cursorX ,
478489 cursorBlink ,
490+ this . _textBlinkStateManager . isBlinkOn ,
479491 this . dimensions . css . cell . width ,
480492 this . _widthCache ,
481493 - 1 ,
@@ -545,6 +557,7 @@ export class DomRenderer extends Disposable implements IRenderer {
545557 cursorInactiveStyle ,
546558 cursorX ,
547559 cursorBlink ,
560+ this . _textBlinkStateManager . isBlinkOn ,
548561 this . dimensions . css . cell . width ,
549562 this . _widthCache ,
550563 enabled ? ( i === y ? x : 0 ) : - 1 ,
0 commit comments