Skip to content

Commit

Permalink
Correct support for the bright colors on windows - regression fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jycchoi committed Nov 15, 2017
1 parent 769ebe0 commit 5294c87
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,18 @@ protected void processCursorToColumn(int x) throws IOException {
@Override
protected void processSetForegroundColor(int color, boolean bright) throws IOException {
info.attributes = (short) ((info.attributes & ~0x0007) | ANSI_FOREGROUND_COLOR_MAP[color]);
info.attributes = (short) ((info.attributes & ~FOREGROUND_INTENSITY) | (bright ? FOREGROUND_INTENSITY : 0));
if (bright) {
info.attributes |= FOREGROUND_INTENSITY;
}
applyAttribute();
}

@Override
protected void processSetBackgroundColor(int color, boolean bright) throws IOException {
info.attributes = (short) ((info.attributes & ~0x0070) | ANSI_BACKGROUND_COLOR_MAP[color]);
info.attributes = (short) ((info.attributes & ~BACKGROUND_INTENSITY) | (bright ? BACKGROUND_INTENSITY : 0));
if (bright) {
info.attributes |= BACKGROUND_INTENSITY;
}
applyAttribute();
}

Expand Down

0 comments on commit 5294c87

Please sign in to comment.