MCPcopy Index your code
hub / github.com/python/mypy / get_terminal_width

Function get_terminal_width

mypy/util.py:527–533  ·  view source on GitHub ↗

Get current terminal width if possible, otherwise return the default one.

()

Source from the content-addressed store, hash-verified

525
526
527def 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
536def soft_wrap(msg: str, max_len: int, first_offset: int, num_indent: int = 0) -> str:

Callers 3

requestFunction · 0.90
fit_in_terminalMethod · 0.85

Calls 1

intClass · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…