@Override
    protected ConsoleReader createConsoleReader() {
      try {
        output = new ByteArrayOutputStream(1024 * 10);
        PrintStream sysout = new PrintStream(output);
        setGfshOutErr(sysout);
        return new ConsoleReader(new FileInputStream(FileDescriptor.in), sysout);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
Setup console-reader to capture Shell output
geode-dunit/src/main/java/org/apache/geode/management/internal/cli/HeadlessGfsh.java