MCPcopy Index your code
hub / github.com/RustPython/RustPython / getheightwidth

Method getheightwidth

Lib/_pyrepl/windows_console.py:356–365  ·  view source on GitHub ↗

Return (height, width) where height and width are the height and width of the terminal window in characters.

(self)

Source from the content-addressed store, hash-verified

354 self._hide_cursor()
355
356 def getheightwidth(self) -> tuple[int, int]:
357 """Return (height, width) where height and width are the height
358 and width of the terminal window in characters."""
359 info = CONSOLE_SCREEN_BUFFER_INFO()
360 if not GetConsoleScreenBufferInfo(OutHandle, info):
361 raise WinError(GetLastError())
362 return (
363 info.srWindow.Bottom - info.srWindow.Top + 1,
364 info.srWindow.Right - info.srWindow.Left + 1,
365 )
366
367 def _getscrollbacksize(self) -> int:
368 info = CONSOLE_SCREEN_BUFFER_INFO()

Callers 2

_scrollMethod · 0.95
prepareMethod · 0.95

Calls 3

WinErrorFunction · 0.90
GetLastErrorFunction · 0.70

Tested by

no test coverage detected