Skip to content

Commit

Permalink
Merge pull request #99 from jycchoi/master
Browse files Browse the repository at this point in the history
Correct support for the bright colors on windows - regression fix
  • Loading branch information
gnodet authored Dec 1, 2017
2 parents f7a84bf + 5294c87 commit 3b2eab6
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 3b2eab6

Please sign in to comment.