X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=text_utils.py;h=890bc630f870c23ad3fabb2b31248ac359c98b26;hb=91df4fa006f7f4fba8e38a97941c5a4ad9b83706;hp=6437e62930d754bc7303e0550f262eee0b6746f1;hpb=ba21e38cdb3d504a69f6808913ea2a649ab4e916;p=python_utils.git diff --git a/text_utils.py b/text_utils.py index 6437e62..890bc63 100644 --- a/text_utils.py +++ b/text_utils.py @@ -44,31 +44,37 @@ def get_console_rows_columns() -> RowsColumns: rows: Optional[str] = os.environ.get('LINES', None) cols: Optional[str] = os.environ.get('COLUMNS', None) if not rows or not cols: + logger.debug('Rows: %s, cols: %s, trying stty.', rows, cols) try: rows, cols = cmd( "stty size", timeout_seconds=1.0, ).split() - except Exception: + except Exception as e: + logger.exception(e) rows = None cols = None if rows is None: + logger.debug('Rows: %s, cols: %s, tput rows.', rows, cols) try: rows = cmd( "tput rows", timeout_seconds=1.0, ) - except Exception: + except Exception as e: + logger.exception(e) rows = None if cols is None: + logger.debug('Rows: %s, cols: %s, tput cols.', rows, cols) try: cols = cmd( "tput cols", timeout_seconds=1.0, ) - except Exception: + except Exception as e: + logger.exception(e) cols = None if not rows or not cols: