Skip to content

Commit 5f8eb45

Browse files
committed
Correct support for the bright colors on windows - regression fix
reported #99 fix after #95 PrintStream copy of OutputStream
1 parent 5ac2049 commit 5f8eb45

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jansi/src/main/java/org/fusesource/jansi/WindowsAnsiPrintStream.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,18 @@ protected void processCursorToColumn(int x) throws IOException {
245245
@Override
246246
protected void processSetForegroundColor(int color, boolean bright) throws IOException {
247247
info.attributes = (short) ((info.attributes & ~0x0007) | ANSI_FOREGROUND_COLOR_MAP[color]);
248-
info.attributes = (short) ((info.attributes & ~FOREGROUND_INTENSITY) | (bright ? FOREGROUND_INTENSITY : 0));
248+
if (bright) {
249+
info.attributes |= FOREGROUND_INTENSITY;
250+
}
249251
applyAttribute();
250252
}
251253

252254
@Override
253255
protected void processSetBackgroundColor(int color, boolean bright) throws IOException {
254256
info.attributes = (short) ((info.attributes & ~0x0070) | ANSI_BACKGROUND_COLOR_MAP[color]);
255-
info.attributes = (short) ((info.attributes & ~BACKGROUND_INTENSITY) | (bright ? BACKGROUND_INTENSITY : 0));
257+
if (bright) {
258+
info.attributes |= BACKGROUND_INTENSITY;
259+
}
256260
applyAttribute();
257261
}
258262

0 commit comments

Comments
 (0)