Skip to content

Commit

Permalink
Fix console display issue on Pterodactyl panel
Browse files Browse the repository at this point in the history
No need to add `-Dterminal.jline=false -Dterminal.ansi=true` by self
  • Loading branch information
Dreeam-qwq committed Jun 26, 2024
1 parent bd2cf6d commit fac22f8
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 97c7afc78350e25c5853d5c2fe703131af78d531..0e3d538579acfab6f190c9b76f4b522989092f00 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -328,6 +328,14 @@ public class Main {
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
+
net.minecraft.server.Main.main(options);
} catch (Throwable t) {
t.printStackTrace();
File renamed without changes.

0 comments on commit fac22f8

Please sign in to comment.