summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2013-12-03 11:16:01 -0600
committerTravis Watkins <amaranth@ubuntu.com>2013-12-03 11:21:26 -0600
commitbc0ac480747d1976139db486d904b2f5e32091fe (patch)
treee246ea895b0cc773972f3a35e2a36ea013a675ac /src/main/java
parent39719fff74e7eb64842f5c2f243c1fea1d51659b (diff)
downloadcraftbukkit-bc0ac480747d1976139db486d904b2f5e32091fe.tar
craftbukkit-bc0ac480747d1976139db486d904b2f5e32091fe.tar.gz
craftbukkit-bc0ac480747d1976139db486d904b2f5e32091fe.tar.lz
craftbukkit-bc0ac480747d1976139db486d904b2f5e32091fe.tar.xz
craftbukkit-bc0ac480747d1976139db486d904b2f5e32091fe.zip
Try to detect when to disable jline automatically. Fixes BUKKIT-5028
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/MinecraftServer.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c6710622..c1c4aa06 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