From 08e2c4a059f5060a77ebcd114b998679903f3661 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Wed, 26 Apr 2017 14:34:37 +0200 Subject: [PATCH] Correct support for the bright colors on windows --- .../java/org/fusesource/jansi/WindowsAnsiOutputStream.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java b/jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java index c1245d5d..232f2cba 100644 --- a/jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java +++ b/jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java @@ -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(); }