Get current terminal width if possible, otherwise return the default one.
()
| 525 | |
| 526 | |
| 527 | def get_terminal_width() -> int: |
| 528 | """Get current terminal width if possible, otherwise return the default one.""" |
| 529 | return ( |
| 530 | int(os.getenv("MYPY_FORCE_TERMINAL_WIDTH", "0")) |
| 531 | or shutil.get_terminal_size().columns |
| 532 | or DEFAULT_COLUMNS |
| 533 | ) |
| 534 | |
| 535 | |
| 536 | def soft_wrap(msg: str, max_len: int, first_offset: int, num_indent: int = 0) -> str: |
searching dependent graphs…