Skip to content

Commit

Permalink
Correct support for the bright colors on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Apr 26, 2017
1 parent dbf2e8c commit 08e2c4a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,24 +241,28 @@ 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));
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));
applyAttribute();
}

@Override
protected void processDefaultTextColor() throws IOException {
info.attributes = (short) ((info.attributes & ~0x000F) | (originalColors & 0xF));
info.attributes = (short) (info.attributes & ~FOREGROUND_INTENSITY);
applyAttribute();
}

@Override
protected void processDefaultBackgroundColor() throws IOException {
info.attributes = (short) ((info.attributes & ~0x00F0) | (originalColors & 0xF0));
info.attributes = (short) (info.attributes & ~BACKGROUND_INTENSITY);
applyAttribute();
}

Expand Down

0 comments on commit 08e2c4a

Please sign in to comment.