class_docstr: Typical usage:
  
  ::
  
      output = Vt100_Output.from_pty(sys.stdout)
      r = Renderer(style, output)
      r.render(app, layout=...)
class_docstr_tok: ["Typical","usage",":",":",":","output","=","Vt100_Output.from_pty","(","sys.stdout",")","r","=","Renderer","(","style",",","output",")","r.render","(","app",",","layout=","...",")"]
docstr: Get current cursor position.
  
  We do this to calculate the minimum available height that we can
  consume for rendering the prompt. This is the available space below te
  cursor.
  
  For vt100: Do CPR request. (answer will arrive later.)
  For win32: Do API call. (Answer comes immediately.)
docstr_tok: ["Get","current","cursor","position",".","We","do","this","to","calculate","the","minimum","available","height","that","we","can","consume","for","rendering","the","prompt",".","This","is","the","available","space","below","te","cursor",".","For","vt100",":","Do","CPR","request",".","(","answer","will","arrive","later",".",")","For","win32",":","Do","API","call",".","(","Answer","comes","immediately",".",")"]
code: def request_absolute_cursor_position(self) -> None:
      """
      Get current cursor position.
  
      We do this to calculate the minimum available height that we can
      consume for rendering the prompt. This is the available space below te
      cursor.
  
      For vt100: Do CPR request. (answer will arrive later.)
      For win32: Do API call. (Answer comes immediately.)
      """
      # Only do this request when the cursor is at the top row. (after a
      # clear or reset). We will rely on that in `report_absolute_cursor_row`.
      assert self._cursor_pos.y == 0
  
      # In full-screen mode, always use the total height as min-available-height.
      if self.full_screen:
          self._min_available_height = self.output.get_size().rows
          return
  
      # For Win32, we have an API call to get the number of rows below the
      # cursor.
      try:
          self._min_available_height = (
              self.output.get_rows_below_cursor_position()
          )
          return
      except NotImplementedError:
          pass
  
      # Use CPR.
      if self.cpr_support == CPR_Support.NOT_SUPPORTED:
          return
  
      def do_cpr() -> None:
          # Asks for a cursor position report (CPR).
          self._waiting_for_cpr_futures.append(Future())
          self.output.ask_for_cpr()
  
      if self.cpr_support == CPR_Support.SUPPORTED:
          do_cpr()
          return
  
      # If we don't know whether CPR is supported, only do a request if
      # none is pending, and test it, using a timer.
      if self.waiting_for_cpr:
          return
  
      do_cpr()
  
      async def timer() -> None:
          await sleep(self.CPR_TIMEOUT)
  
          # Not set in the meantime -> not supported.
          if self.cpr_support == CPR_Support.UNKNOWN:
              self.cpr_support = CPR_Support.NOT_SUPPORTED
  
              if self.cpr_not_supported_callback:
                  # Make sure to call this callback in the main thread.
                  self.cpr_not_supported_callback()
  
      get_app().create_background_task(timer())
  
imports: from __future__ import annotations
  from asyncio import FIRST_COMPLETED, Future, ensure_future, sleep, wait
  from collections import deque
  from enum import Enum
  from typing import TYPE_CHECKING, Any, Callable, Dict, Hashable
  from prompt_toolkit.application.current import get_app
  from prompt_toolkit.cursor_shapes import CursorShape
  from prompt_toolkit.data_structures import Point, Size
  from prompt_toolkit.filters import FilterOrBool, to_filter
  from prompt_toolkit.formatted_text import AnyFormattedText, to_formatted_text
  from prompt_toolkit.layout.mouse_handlers import MouseHandlers
  from prompt_toolkit.layout.screen import Char, Screen, WritePosition
  from prompt_toolkit.output import ColorDepth, Output
  from prompt_toolkit.styles import Attrs, BaseStyle, DummyStyleTransformation, StyleTransformation
label_desc: Use image node_id 6 for calling the Renderer obj's underlying member method code with example usage: obj.request_absolute_cursor_position() without return types