private static String readLine(ConsoleReader reader, String prompt) throws IOException {
    String earlierLine = reader.getCursorBuffer().toString();
    String readLine;
    try {
      readLine = reader.readLine(prompt);
    } catch (IndexOutOfBoundsException e) {
      if (earlierLine.length() == 0) {
        reader.println();
        readLine = LINE_SEPARATOR;
        reader.getCursorBuffer().cursor = 0;
      } else {
        readLine = readLine(reader, prompt);
      }
    }
    return readLine;
  }
Create a GemFire shell using the specified arguments. Console for user inputs is made available
if <code>launchShell</code> is set to <code>true</code>.

@param launchShell whether to make Console available
@param args arguments to be used to create a GemFire shell instance or execute command
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/shell/Gfsh.java