From 682f9c3eb4df5e95ac6383d20bddcd788cccaacd Mon Sep 17 00:00:00 2001 From: Rico Krasowski Date: Wed, 22 Jan 2014 01:27:18 +0100 Subject: [PATCH] implemented missing functions to set the default text and background colors on Windows --- .../fusesource/jansi/WindowsAnsiOutputStream.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java b/jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java index 3896897f..415afff0 100644 --- a/jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java +++ b/jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java @@ -238,6 +238,18 @@ protected void processSetBackgroundColor(int color) throws IOException { applyAttribute(); } + @Override + protected void processDefaultTextColor() throws IOException { + info.attributes = (short)((info.attributes & ~0x000F ) | (originalColors & 0xF)); + applyAttribute(); + } + + @Override + protected void processDefaultBackgroundColor() throws IOException { + info.attributes = (short)((info.attributes & ~0x00F0 ) | (originalColors & 0xF0)); + applyAttribute(); + } + @Override protected void processAttributeRest() throws IOException { info.attributes = (short)((info.attributes & ~0x00FF ) | originalColors);