mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-25 09:34:44 +01:00
Begin console output with ANSI line erase.
By: Jofkos <JofkosDE@gmail.com>
This commit is contained in:
parent
4d559fa1ca
commit
5c7c823a9a
1 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,8 @@ import java.util.logging.Logger;
|
||||||
import jline.console.ConsoleReader;
|
import jline.console.ConsoleReader;
|
||||||
import com.mojang.util.QueueLogAppender;
|
import com.mojang.util.QueueLogAppender;
|
||||||
import org.bukkit.craftbukkit.Main;
|
import org.bukkit.craftbukkit.Main;
|
||||||
|
import org.fusesource.jansi.Ansi;
|
||||||
|
import org.fusesource.jansi.Ansi.Erase;
|
||||||
|
|
||||||
public class TerminalConsoleWriterThread implements Runnable {
|
public class TerminalConsoleWriterThread implements Runnable {
|
||||||
final private ConsoleReader reader;
|
final private ConsoleReader reader;
|
||||||
|
@ -29,7 +31,7 @@ public class TerminalConsoleWriterThread implements Runnable {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Main.useJline) {
|
if (Main.useJline) {
|
||||||
reader.print(ConsoleReader.RESET_LINE + "");
|
reader.print(Ansi.ansi().eraseLine(Erase.ALL).toString() + ConsoleReader.RESET_LINE);
|
||||||
reader.flush();
|
reader.flush();
|
||||||
output.write(message.getBytes());
|
output.write(message.getBytes());
|
||||||
output.flush();
|
output.flush();
|
||||||
|
|
Loading…
Add table
Reference in a new issue