Skip to content

Commit 3b2eab6

Browse files
authored
Merge pull request #99 from jycchoi/master
Correct support for the bright colors on windows - regression fix
2 parents f7a84bf + 5294c87 commit 3b2eab6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

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

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

0 commit comments

Comments
 (0)