class_docstr: I/O abstraction for rendering to Windows consoles.
  (cmd.exe and similar.)
class_docstr_tok: ["I\/O","abstraction","for","rendering","to","Windows","consoles",".","(","cmd.exe","and","similar",".",")"]
docstr: To be called before drawing the prompt. This should scroll the console
  to left, with the cursor at the bottom (if possible).
docstr_tok: ["To","be","called","before","drawing","the","prompt",".","This","should","scroll","the","console","to","left",",","with","the","cursor","at","the","bottom","(","if","possible",")","."]
code: def scroll_buffer_to_prompt(self) -> None:
      """
      To be called before drawing the prompt. This should scroll the console
      to left, with the cursor at the bottom (if possible).
      """
      # Get current window size
      info = self.get_win32_screen_buffer_info()
      sr = info.srWindow
      cursor_pos = info.dwCursorPosition
  
      result = SMALL_RECT()
  
      # Scroll to the left.
      result.Left = 0
      result.Right = sr.Right - sr.Left
  
      # Scroll vertical
      win_height = sr.Bottom - sr.Top
      if 0 < sr.Bottom - cursor_pos.Y < win_height - 1:
          # no vertical scroll if cursor already on the screen
          result.Bottom = sr.Bottom
      else:
          result.Bottom = max(win_height, cursor_pos.Y)
      result.Top = result.Bottom - win_height
  
      # Scroll API
      self._winapi(
          windll.kernel32.SetConsoleWindowInfo,
          self.hconsole,
          True,
          byref(result),
      )
  
imports: from __future__ import annotations
  import sys
  import os
  from ctypes import ArgumentError, byref, c_char, c_long, c_uint, c_ulong, pointer
  from ctypes.wintypes import DWORD, HANDLE
  from typing import Callable, TextIO, TypeVar
  from prompt_toolkit.cursor_shapes import CursorShape
  from prompt_toolkit.data_structures import Size
  from prompt_toolkit.styles import ANSI_COLOR_NAMES, Attrs
  from prompt_toolkit.utils import get_cwidth
  from prompt_toolkit.win32_types import CONSOLE_SCREEN_BUFFER_INFO, COORD, SMALL_RECT, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE
  from ..utils import SPHINX_AUTODOC_RUNNING
  from .base import Output
  from .color_depth import ColorDepth
label_desc: Use image node_id 26 for calling the Win32Output obj's underlying member method code with example usage: obj.scroll_buffer_to_prompt() without return types