Skip to content

Commit d3b762e

Browse files
authored
Merge pull request #3503 from jerch/fix_cursor_dom
fix DECTCEM in DOM renderer
2 parents 3b23921 + 0c60478 commit d3b762e

2 files changed

Lines changed: 35 additions & 28 deletions

File tree

src/browser/renderer/dom/DomRendererRowFactory.test.ts

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { NULL_CELL_CODE, NULL_CELL_WIDTH, NULL_CELL_CHAR, DEFAULT_ATTR, FgFlags,
1010
import { BufferLine, DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
1111
import { IBufferLine } from 'common/Types';
1212
import { CellData } from 'common/buffer/CellData';
13-
import { MockOptionsService } from 'common/TestUtils.test';
13+
import { MockCoreService, MockOptionsService } from 'common/TestUtils.test';
1414
import { css } from 'browser/Color';
1515
import { MockCharacterJoinerService } from 'browser/TestUtils.test';
1616

@@ -21,30 +21,36 @@ describe('DomRendererRowFactory', () => {
2121

2222
beforeEach(() => {
2323
dom = new jsdom.JSDOM('');
24-
rowFactory = new DomRendererRowFactory(dom.window.document, {
25-
background: css.toColor('#010101'),
26-
foreground: css.toColor('#020202'),
27-
ansi: [
28-
// dark:
29-
css.toColor('#2e3436'),
30-
css.toColor('#cc0000'),
31-
css.toColor('#4e9a06'),
32-
css.toColor('#c4a000'),
33-
css.toColor('#3465a4'),
34-
css.toColor('#75507b'),
35-
css.toColor('#06989a'),
36-
css.toColor('#d3d7cf'),
37-
// bright:
38-
css.toColor('#555753'),
39-
css.toColor('#ef2929'),
40-
css.toColor('#8ae234'),
41-
css.toColor('#fce94f'),
42-
css.toColor('#729fcf'),
43-
css.toColor('#ad7fa8'),
44-
css.toColor('#34e2e2'),
45-
css.toColor('#eeeeec')
46-
]
47-
} as any, new MockCharacterJoinerService(), new MockOptionsService({ drawBoldTextInBrightColors: true }));
24+
rowFactory = new DomRendererRowFactory(
25+
dom.window.document,
26+
{
27+
background: css.toColor('#010101'),
28+
foreground: css.toColor('#020202'),
29+
ansi: [
30+
// dark:
31+
css.toColor('#2e3436'),
32+
css.toColor('#cc0000'),
33+
css.toColor('#4e9a06'),
34+
css.toColor('#c4a000'),
35+
css.toColor('#3465a4'),
36+
css.toColor('#75507b'),
37+
css.toColor('#06989a'),
38+
css.toColor('#d3d7cf'),
39+
// bright:
40+
css.toColor('#555753'),
41+
css.toColor('#ef2929'),
42+
css.toColor('#8ae234'),
43+
css.toColor('#fce94f'),
44+
css.toColor('#729fcf'),
45+
css.toColor('#ad7fa8'),
46+
css.toColor('#34e2e2'),
47+
css.toColor('#eeeeec')
48+
]
49+
} as any,
50+
new MockCharacterJoinerService(),
51+
new MockOptionsService({ drawBoldTextInBrightColors: true }),
52+
new MockCoreService()
53+
);
4854
lineData = createEmptyLineData(2);
4955
});
5056

src/browser/renderer/dom/DomRendererRowFactory.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { IBufferLine } from 'common/Types';
77
import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';
88
import { NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Attributes } from 'common/buffer/Constants';
99
import { CellData } from 'common/buffer/CellData';
10-
import { IOptionsService } from 'common/services/Services';
10+
import { ICoreService, IOptionsService } from 'common/services/Services';
1111
import { color, rgba } from 'browser/Color';
1212
import { IColorSet, IColor } from 'browser/Types';
1313
import { ICharacterJoinerService } from 'browser/services/Services';
@@ -31,7 +31,8 @@ export class DomRendererRowFactory {
3131
private readonly _document: Document,
3232
private _colors: IColorSet,
3333
@ICharacterJoinerService private readonly _characterJoinerService: ICharacterJoinerService,
34-
@IOptionsService private readonly _optionsService: IOptionsService
34+
@IOptionsService private readonly _optionsService: IOptionsService,
35+
@ICoreService private readonly _coreService: ICoreService
3536
) {
3637
}
3738

@@ -110,7 +111,7 @@ export class DomRendererRowFactory {
110111
}
111112
}
112113

113-
if (isCursorRow && x === cursorX) {
114+
if (!this._coreService.isCursorHidden && isCursorRow && x === cursorX) {
114115
charElement.classList.add(CURSOR_CLASS);
115116

116117
if (cursorBlink) {

0 commit comments

Comments
 (0)