mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 16:57:42 +01:00
Merge pull request #743 from Minecrell/ignore-eot
Continue reading from console input after EOT
This commit is contained in:
commit
9a3f146c2e
@ -115,7 +115,7 @@ index 00000000..24f30efb
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
|
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 00000000..dcd31fbc
|
index 00000000..d5bc6149
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
|
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
|
||||||
@@ -0,0 +0,0 @@
|
@@ -0,0 +0,0 @@
|
||||||
@ -124,6 +124,7 @@ index 00000000..dcd31fbc
|
|||||||
+import net.minecraft.server.DedicatedServer;
|
+import net.minecraft.server.DedicatedServer;
|
||||||
+import net.minecrell.terminalconsole.TerminalConsoleAppender;
|
+import net.minecrell.terminalconsole.TerminalConsoleAppender;
|
||||||
+import org.bukkit.craftbukkit.command.ConsoleCommandCompleter;
|
+import org.bukkit.craftbukkit.command.ConsoleCommandCompleter;
|
||||||
|
+import org.jline.reader.EndOfFileException;
|
||||||
+import org.jline.reader.LineReader;
|
+import org.jline.reader.LineReader;
|
||||||
+import org.jline.reader.LineReaderBuilder;
|
+import org.jline.reader.LineReaderBuilder;
|
||||||
+import org.jline.reader.UserInterruptException;
|
+import org.jline.reader.UserInterruptException;
|
||||||
@ -152,7 +153,13 @@ index 00000000..dcd31fbc
|
|||||||
+ try {
|
+ try {
|
||||||
+ String line;
|
+ String line;
|
||||||
+ while (!server.isStopped() && server.isRunning()) {
|
+ while (!server.isStopped() && server.isRunning()) {
|
||||||
+ line = reader.readLine("> ");
|
+ try {
|
||||||
|
+ line = reader.readLine("> ");
|
||||||
|
+ } catch (EndOfFileException ignored) {
|
||||||
|
+ // Continue reading after EOT
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ if (line == null) {
|
+ if (line == null) {
|
||||||
+ break;
|
+ break;
|
||||||
+ }
|
+ }
|
||||||
|
Loading…
Reference in New Issue
Block a user