From bc0ac480747d1976139db486d904b2f5e32091fe Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Tue, 3 Dec 2013 11:16:01 -0600 Subject: [PATCH] Try to detect when to disable jline automatically. Fixes BUKKIT-5028 --- src/main/java/net/minecraft/server/MinecraftServer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index c6710622dd..c1c4aa061d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -113,6 +113,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo // CraftBukkit start this.options = options; + // Try to see if we're actually running in a terminal, disable jline if not + if (System.console() == null) { + System.setProperty("jline.terminal", "jline.UnsupportedTerminal"); + org.bukkit.craftbukkit.Main.useJline = false; + } + try { this.reader = new ConsoleReader(System.in, System.out); this.reader.setExpandEvents(false); // Avoid parsing exceptions for uncommonly used event designators