Render non-block cursors as-is when terminal is unfocused

This commit is contained in:
JeffreyCA
2019-10-07 22:25:47 -07:00
parent cad9477eef
commit efbdbd3f3b
3 changed files with 17 additions and 7 deletions
@@ -139,12 +139,17 @@ export class CursorRenderLayer extends BaseRenderLayer {
this._clearCursor();
this._ctx.save();
this._ctx.fillStyle = this._colors.cursor.css;
this._renderBlurCursor(terminal, terminal.buffer.cursorX, viewportRelativeCursorY, this._cell);
const cursorStyle = terminal.getOption('cursorStyle')
if (cursorStyle && cursorStyle != 'block') {
this._cursorRenderers[cursorStyle](terminal, terminal.buffer.cursorX, viewportRelativeCursorY, this._cell);
} else {
this._renderBlurCursor(terminal, terminal.buffer.cursorX, viewportRelativeCursorY, this._cell);
}
this._ctx.restore();
this._state.x = terminal.buffer.cursorX;
this._state.y = viewportRelativeCursorY;
this._state.isFocused = false;
this._state.style = terminal.getOption('cursorStyle');
this._state.style = cursorStyle;
this._state.width = this._cell.getWidth();
return;
}