@@ -961,6 +961,32 @@ export function injectSharedRendererTests(ctx: ISharedRendererTestContext): void
961961 } ) ;
962962 } ) ;
963963
964+ ( ctx . skipCanvasExceptions ? test . describe . skip : test . describe ) ( 'selectionInactiveBackground' , async ( ) => {
965+ test ( 'should render the the inactive selection when not focused' , async ( ) => {
966+ const theme : ITheme = {
967+ selectionBackground : '#FF000080' ,
968+ selectionInactiveBackground : '#0000FF80'
969+ } ;
970+ await ctx . value . page . evaluate ( `window.term.options.theme = ${ JSON . stringify ( theme ) } ;` ) ;
971+ await ctx . value . proxy . focus ( ) ;
972+ // Check both the cursor line and another line
973+ await ctx . value . proxy . writeln ( '_ ' ) ;
974+ await ctx . value . proxy . write ( '_ ' ) ;
975+ await ctx . value . page . evaluate ( `window.term.selectAll()` ) ;
976+ await pollFor ( ctx . value . page , ( ) => getCellColor ( ctx . value , 1 , 1 ) , [ 128 , 0 , 0 , 255 ] ) ;
977+ await pollFor ( ctx . value . page , ( ) => getCellColor ( ctx . value , 2 , 1 ) , [ 128 , 0 , 0 , 255 ] ) ;
978+ await pollFor ( ctx . value . page , ( ) => getCellColor ( ctx . value , 1 , 2 ) , [ 128 , 0 , 0 , 255 ] ) ;
979+ await pollFor ( ctx . value . page , ( ) => getCellColor ( ctx . value , 2 , 2 ) , [ 128 , 0 , 0 , 255 ] ) ;
980+ await ctx . value . page . evaluate ( `document.activeElement.blur()` ) ;
981+ frameDetails = undefined ;
982+ // Selection only cell needs to be first to ensure renderer has kicked in
983+ await pollFor ( ctx . value . page , ( ) => getCellColor ( ctx . value , 1 , 1 ) , [ 0 , 0 , 128 , 255 ] ) ;
984+ await pollFor ( ctx . value . page , ( ) => getCellColor ( ctx . value , 2 , 1 ) , [ 0 , 0 , 128 , 255 ] ) ;
985+ await pollFor ( ctx . value . page , ( ) => getCellColor ( ctx . value , 1 , 2 ) , [ 0 , 0 , 128 , 255 ] ) ;
986+ await pollFor ( ctx . value . page , ( ) => getCellColor ( ctx . value , 2 , 2 ) , [ 0 , 0 , 128 , 255 ] ) ;
987+ } ) ;
988+ } ) ;
989+
964990 test . describe ( 'allowTransparency' , async ( ) => {
965991 test . beforeEach ( ( ) => ctx . value . page . evaluate ( `term.options.allowTransparency = true` ) ) ;
966992
0 commit comments