Returns the error message if there is a problem initializing the state.
()
| 47 | from .windows_console import _error |
| 48 | |
| 49 | def check() -> str: |
| 50 | """Returns the error message if there is a problem initializing the state.""" |
| 51 | try: |
| 52 | _get_reader() |
| 53 | except _error as e: |
| 54 | if term := os.environ.get("TERM", ""): |
| 55 | term = f"; TERM={term}" |
| 56 | return str(str(e) or repr(e) or "unknown error") + term |
| 57 | return "" |
| 58 | |
| 59 | |
| 60 | def _strip_final_indent(text: str) -> str: |