The corrupted output has been identified due to the "Boolean[1]" being misrecognized as a compound prompt.
The proposed fix waits for the correct prompt before advancing to the next command. Webrev: http://cr.openjdk.java.net/~gadams/8208471/webrev/ Issue: https://bugs.openjdk.java.net/browse/JDK-8208471 Testing is in progress.