Update to jline 2. Fixes BUKKIT-717

JLine 2 allows for better color matching in the console and support for
colors in console on Windows. Hopefully provides better performance as well.

By: EdGruberman <ed@rjump.com>
This commit is contained in:
CraftBukkit/Spigot
2012-03-14 13:59:14 -07:00
parent e8795d1897
commit 01b14886d7
4 changed files with 36 additions and 29 deletions

View File

@@ -4,7 +4,7 @@ import java.io.IOException;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import jline.ConsoleReader;
import jline.console.ConsoleReader;
import org.bukkit.craftbukkit.Main;
public class TerminalConsoleHandler extends ConsoleHandler {
@@ -19,15 +19,15 @@ public class TerminalConsoleHandler extends ConsoleHandler {
public synchronized void flush() {
try {
if (Main.useJline) {
reader.printString(ConsoleReader.RESET_LINE + "");
reader.flushConsole();
reader.print(ConsoleReader.RESET_LINE + "");
reader.flush();
super.flush();
try {
reader.drawLine();
} catch (Throwable ex) {
reader.getCursorBuffer().clearBuffer();
reader.getCursorBuffer().clear();
}
reader.flushConsole();
reader.flush();
} else {
super.flush();
}