code: @Override
     public CursorPosition getCursor()
     {
        if (settings.isAnsiConsole() && Config.isOSPOSIXCompatible())
        {
           try
           {
              StringBuilder col = new StringBuilder(4);
              StringBuilder row = new StringBuilder(4);
              out().print(ANSI.CURSOR_ROW);
              out().flush();
              boolean gotSep = false;
              // read the position
              int[] input = read();
  
              for (int i = 2; i < input.length - 1; i++)
              {
                 if (input[i] == 59) // we got a ';' which is the separator
                    gotSep = true;
                 else
                 {
                    if (gotSep)
                       col.append((char) input[i]);
                    else
                       row.append((char) input[i]);
                 }
              }
              return new CursorPosition(Integer.parseInt(row.toString()),
                       Integer.parseInt(col.toString()));
           }
           catch (Exception e)
           {
              if (settings.isLogging())
                 logger.log(Level.SEVERE,
                          "Failed to find current row with ansi code: ", e);
              return new CursorPosition(-1, -1);
           }
        }
        return new CursorPosition(-1, -1);
     }
docs: Return the row position if we use a ansi terminal Send a terminal: '<ESC>[6n' and we receive the position as: '
  <ESC>[n;mR' where n = current row and m = current column