presto-cli/src/main/java/io/prestosql/cli/ConsolePrinter.java/ConsolePrinter/repositionCursor
class ConsolePrinter:    public void repositionCursor()
    {
        if (lines > 0) {
            if (isRealTerminal()) {
                out.print(cursorUp(lines));
            }
            else {
                out.print('\r');
            }
            out.flush();
            lines = 0;
        }
    }