Get terminal width safely.
()
| 100 | |
| 101 | |
| 102 | def _get_terminal_width() -> int: |
| 103 | """Get terminal width safely.""" |
| 104 | try: |
| 105 | import shutil |
| 106 | return shutil.get_terminal_size().columns |
| 107 | except: |
| 108 | return 80 # Default fallback |
| 109 | |
| 110 | |
| 111 | def _safe_flush(): |
no outgoing calls
no test coverage detected