From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Thu, 27 Jun 2024 01:13:07 +0800 Subject: [PATCH] Fix console output display on Pterodactyl panel Fixed console display issue when the terminal used xterm, should work on Pterodactyl, MCSManager and kind of panel software diff --git a/src/main/java/io/papermc/paper/PaperBootstrap.java b/src/main/java/io/papermc/paper/PaperBootstrap.java index fb19a2f9e219656aa89f6d82edc64bc0d68c1ff1..b4b3264ea7b3f6eb2d693af28a492620026287a8 100644 --- a/src/main/java/io/papermc/paper/PaperBootstrap.java +++ b/src/main/java/io/papermc/paper/PaperBootstrap.java @@ -20,6 +20,13 @@ public final class PaperBootstrap { System.setProperty("org.jline.terminal.disableDeprecatedProviderWarning", "true"); // Leaf - Ignore terminal provider warning if (org.galemc.gale.virtualthread.VirtualThreadService.getJavaMajorVersion() >= 22) System.setProperty("jdk.console", "java.base"); // Leaf - Fix console freeze above JAVA 22 + // Leaf start - Fix console output display on Pterodactyl panel + if (System.getProperty("terminal.jline", "false") != null && System.getProperty("terminal.ansi", "true") != null + && "xterm".equalsIgnoreCase(System.getenv("TERM"))) { + System.setProperty("terminal.jline", "false"); + System.setProperty("terminal.ansi", "true"); + } + // Leaf end - Fix console output display on Pterodactyl panel Main.main(options); }