add handling for default fg color

This commit is contained in:
Jörg Breitbart
2019-04-29 22:33:01 +02:00
parent f4bbfc30f3
commit 42b1dca7db
+5 -1
View File
@@ -322,15 +322,19 @@ export abstract class BaseRenderLayer implements IRenderLayer {
} else { } else {
this._ctx.fillStyle = this._colors.ansi[cell.getBgColor()].css; this._ctx.fillStyle = this._colors.ansi[cell.getBgColor()].css;
} }
} else {
if (cell.isFgDefault()) {
this._ctx.fillStyle = this._colors.foreground.css;
} else if (cell.isFgRGB()) { } else if (cell.isFgRGB()) {
this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`; this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`;
} else if (cell.isFgPalette()) { } else {
let fg = cell.getFgColor(); let fg = cell.getFgColor();
if (terminal.options.drawBoldTextInBrightColors && cell.isBold() && fg < 8) { if (terminal.options.drawBoldTextInBrightColors && cell.isBold() && fg < 8) {
fg += 8; fg += 8;
} }
this._ctx.fillStyle = this._colors.ansi[fg].css; this._ctx.fillStyle = this._colors.ansi[fg].css;
} }
}
this._clipRow(terminal, y); this._clipRow(terminal, y);