def get_terminal_size():
    try:
        rows, columns = run_command(['stty', 'size']).split()
    except OsbsException:
        # not attached to terminal
        logger.info("not attached to terminal")
        return 0, 0
    logger.debug("console size is %s %s", rows, columns)
    return int(rows), int(columns)
get size of console: rows x columns
dataset/ETHPy150Open projectatomic/osbs-client/osbs/cli/render.py/get_terminal_size