From 772038b8d852446b77c9ee857885874f2552e9a6 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Wed, 17 Aug 2022 19:53:17 -0700 Subject: Ugh. Fix a bug in the new refactor of the env var config stuff. --- text_utils.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'text_utils.py') 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: -- cgit v1.3