rows: Union[Optional[str], int] = os.environ.get('LINES', None)
cols: Union[Optional[str], int] = os.environ.get('COLUMNS', None)
rows: Union[Optional[str], int] = os.environ.get('LINES', None)
cols: Union[Optional[str], int] = os.environ.get('COLUMNS', None)
if not rows or not cols:
logger.debug('Rows: %s, cols: %s, trying stty.', rows, cols)
try:
if not rows or not cols:
logger.debug('Rows: %s, cols: %s, trying stty.', rows, cols)
try:
if not rows or not cols:
raise Exception('Can\'t determine console size?!')
return RowsColumns(int(rows), int(cols))
if not rows or not cols:
raise Exception('Can\'t determine console size?!')
return RowsColumns(int(rows), int(cols))