Skip to content

Commit 08e2c4a

Browse files
committed
Correct support for the bright colors on windows
1 parent dbf2e8c commit 08e2c4a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -241,24 +241,28 @@ protected void processCursorToColumn(int x) throws IOException {
241241
@Override
242242
protected void processSetForegroundColor(int color, boolean bright) throws IOException {
243243
info.attributes = (short) ((info.attributes & ~0x0007) | ANSI_FOREGROUND_COLOR_MAP[color]);
244+
info.attributes = (short) ((info.attributes & ~FOREGROUND_INTENSITY) | (bright ? FOREGROUND_INTENSITY : 0));
244245
applyAttribute();
245246
}
246247

247248
@Override
248249
protected void processSetBackgroundColor(int color, boolean bright) throws IOException {
249250
info.attributes = (short) ((info.attributes & ~0x0070) | ANSI_BACKGROUND_COLOR_MAP[color]);
251+
info.attributes = (short) ((info.attributes & ~BACKGROUND_INTENSITY) | (bright ? BACKGROUND_INTENSITY : 0));
250252
applyAttribute();
251253
}
252254

253255
@Override
254256
protected void processDefaultTextColor() throws IOException {
255257
info.attributes = (short) ((info.attributes & ~0x000F) | (originalColors & 0xF));
258+
info.attributes = (short) (info.attributes & ~FOREGROUND_INTENSITY);
256259
applyAttribute();
257260
}
258261

259262
@Override
260263
protected void processDefaultBackgroundColor() throws IOException {
261264
info.attributes = (short) ((info.attributes & ~0x00F0) | (originalColors & 0xF0));
265+
info.attributes = (short) (info.attributes & ~BACKGROUND_INTENSITY);
262266
applyAttribute();
263267
}
264268

0 commit comments

Comments
 (0)