From 28868afea4981b25815eab912254d6cbea686930 Mon Sep 17 00:00:00 2001 From: mattirn Date: Wed, 16 Dec 2020 17:41:10 +0100 Subject: [PATCH] SystemRegistryImpl: reset captured command output in REPL-loop --- .../main/java/org/jline/console/impl/SystemRegistryImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java b/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java index e53ff5d80..266494057 100644 --- a/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java +++ b/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java @@ -505,6 +505,10 @@ public void close() { reset(); } + public void resetOutput() { + output = null; + } + private void reset() { outputStream = null; System.setOut(origOut); @@ -1237,6 +1241,7 @@ private ExecutionResult postProcess(CommandData cmd, boolean statement, ConsoleE public void cleanUp() { outputStream.close(); + outputStream.resetOutput(); if (consoleEngine() != null) { consoleEngine().purge(); }