Skip to content

Commit 455c744

Browse files
committed
Uniform cursor unfocused rendering. #4441
1 parent 4037b94 commit 455c744

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

addons/xterm-addon-canvas/src/CursorRenderLayer.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
149149
this._ctx.save();
150150
this._ctx.fillStyle = this._themeService.colors.cursor.css;
151151
const cursorStyle = this._optionsService.rawOptions.cursorStyle;
152-
if (cursorStyle && cursorStyle !== 'block') {
153-
this._cursorRenderers[cursorStyle](cursorX, viewportRelativeCursorY, this._cell);
154-
} else {
155-
this._renderBlurCursor(cursorX, viewportRelativeCursorY, this._cell);
156-
}
152+
this._renderBlurCursor(cursorX, viewportRelativeCursorY, this._cell);
157153
this._ctx.restore();
158154
this._state.x = cursorX;
159155
this._state.y = viewportRelativeCursorY;

addons/xterm-addon-webgl/src/renderLayer/CursorRenderLayer.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
149149
this._ctx.save();
150150
this._ctx.fillStyle = this._themeService.colors.cursor.css;
151151
const cursorStyle = terminal.options.cursorStyle;
152-
if (cursorStyle && cursorStyle !== 'block') {
153-
this._cursorRenderers[cursorStyle](terminal, cursorX, viewportRelativeCursorY, this._cell);
154-
} else {
155-
this._renderBlurCursor(terminal, cursorX, viewportRelativeCursorY, this._cell);
156-
}
152+
this._renderBlurCursor(terminal, cursorX, viewportRelativeCursorY, this._cell);
157153
this._ctx.restore();
158154
this._state.x = cursorX;
159155
this._state.y = viewportRelativeCursorY;

src/browser/renderer/dom/DomRenderer.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,16 @@ export class DomRenderer extends Disposable implements IRenderer {
184184
` outline: 1px solid ${colors.cursor.css};` +
185185
` outline-offset: -1px;` +
186186
`}` +
187+
`${this._terminalSelector} .${ROW_CONTAINER_CLASS}:not(.${FOCUS_CLASS}) .${CURSOR_CLASS}.${CURSOR_STYLE_BAR_CLASS} {` +
188+
` outline: 1px solid ${colors.cursor.css};` +
189+
` outline-offset: -1px;` +
190+
` width: ${this.dimensions.css.cell.width}px` +
191+
`}` +
192+
`${this._terminalSelector} .${ROW_CONTAINER_CLASS}:not(.${FOCUS_CLASS}) .${CURSOR_CLASS}.${CURSOR_STYLE_UNDERLINE_CLASS} {` +
193+
` outline: 1px solid ${colors.cursor.css};` +
194+
` outline-offset: -1px;` +
195+
` width: ${this.dimensions.css.cell.width}px` +
196+
`}` +
187197
`${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${CURSOR_CLASS}.${CURSOR_BLINK_CLASS}:not(.${CURSOR_STYLE_BLOCK_CLASS}) {` +
188198
` animation: blink_box_shadow` + `_` + this._terminalClass + ` 1s step-end infinite;` +
189199
`}` +

0 commit comments

Comments
 (0)