Add cursorInactiveStyle option

This commit is contained in:
tisilent
2023-08-10 16:11:04 +08:00
parent 4f41070b45
commit 482dad3036
10 changed files with 115 additions and 46 deletions
@@ -27,7 +27,11 @@ export const enum RowCss {
CURSOR_BLINK_CLASS = 'xterm-cursor-blink',
CURSOR_STYLE_BLOCK_CLASS = 'xterm-cursor-block',
CURSOR_STYLE_BAR_CLASS = 'xterm-cursor-bar',
CURSOR_STYLE_UNDERLINE_CLASS = 'xterm-cursor-underline'
CURSOR_STYLE_UNDERLINE_CLASS = 'xterm-cursor-underline',
CURSOR_INACTIVE_STYLE_OUTLINE_CLASS = 'xterm-cursor-inactive-outline',
CURSOR_INACTIVE_STYLE_LINE_CLASS = 'xterm-cursor-inactive-line',
CURSOR_INACTIVE_STYLE_UNDERLINE_CLASS = 'xterm-cursor-inactive-underline',
CURSOR_INACTIVE_STYLE_NONE_CLASS = 'xterm-cursor-inactive-none'
}
@@ -61,6 +65,7 @@ export class DomRendererRowFactory {
row: number,
isCursorRow: boolean,
cursorStyle: string | undefined,
cursorInactiveStyle: string | undefined,
cursorX: number,
cursorBlink: boolean,
cellWidth: number,
@@ -207,6 +212,22 @@ export class DomRendererRowFactory {
? RowCss.CURSOR_STYLE_UNDERLINE_CLASS
: RowCss.CURSOR_STYLE_BLOCK_CLASS
);
if (cursorInactiveStyle) {
switch (cursorInactiveStyle) {
case 'outline':
classes.push(RowCss.CURSOR_INACTIVE_STYLE_OUTLINE_CLASS);
break;
case 'line':
classes.push(RowCss.CURSOR_INACTIVE_STYLE_LINE_CLASS);
break;
case 'underline':
classes.push(RowCss.CURSOR_INACTIVE_STYLE_UNDERLINE_CLASS);
break;
default:
classes.push(RowCss.CURSOR_INACTIVE_STYLE_NONE_CLASS);
break;
}
}
}
if (cell.isBold()) {