MCPcopy Index your code
hub / github.com/pyinvoke/invoke / pty_size

Function pty_size

invoke/terminals.py:116–128  ·  view source on GitHub ↗

Determine current local pseudoterminal dimensions. :returns: A ``(num_cols, num_rows)`` two-tuple describing PTY size. Defaults to ``(80, 24)`` if unable to get a sensible result dynamically. .. versionadded:: 1.0

()

Source from the content-addressed store, hash-verified

114
115
116def pty_size() -> Tuple[int, int]:
117 """
118 Determine current local pseudoterminal dimensions.
119
120 :returns:
121 A ``(num_cols, num_rows)`` two-tuple describing PTY size. Defaults to
122 ``(80, 24)`` if unable to get a sensible result dynamically.
123
124 .. versionadded:: 1.0
125 """
126 cols, rows = _pty_size()
127 # TODO: make defaults configurable?
128 return (cols or 80, rows or 24)
129
130
131def stdin_is_foregrounded_tty(stream: IO) -> bool:

Callers 2

startMethod · 0.70
print_columnsMethod · 0.70

Calls 1

_pty_sizeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…