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=","...",")"]
code: def reset(
      self, _scroll: bool = False, leave_alternate_screen: bool = True
  ) -> None:
      # Reset position
      self._cursor_pos = Point(x=0, y=0)
  
      # Remember the last screen instance between renderers. This way,
      # we can create a `diff` between two screens and only output the
      # difference. It's also to remember the last height. (To show for
      # instance a toolbar at the bottom position.)
      self._last_screen: Screen | None = None
      self._last_size: Size | None = None
      self._last_style: str | None = None
      self._last_cursor_shape: CursorShape | None = None
  
      # Default MouseHandlers. (Just empty.)
      self.mouse_handlers = MouseHandlers()
  
      #: Space from the top of the layout, until the bottom of the terminal.
      #: We don't know this until a `report_absolute_cursor_row` call.
      self._min_available_height = 0
  
      # In case of Windows, also make sure to scroll to the current cursor
      # position. (Only when rendering the first time.)
      # It does nothing for vt100 terminals.
      if _scroll:
          self.output.scroll_buffer_to_prompt()
  
      # Quit alternate screen.
      if self._in_alternate_screen and leave_alternate_screen:
          self.output.quit_alternate_screen()
          self._in_alternate_screen = False
  
      # Disable mouse support.
      if self._mouse_support_enabled:
          self.output.disable_mouse_support()
          self._mouse_support_enabled = False
  
      # Disable bracketed paste.
      if self._bracketed_paste_enabled:
          self.output.disable_bracketed_paste()
          self._bracketed_paste_enabled = False
  
      self.output.reset_cursor_shape()
  
      # NOTE: No need to set/reset cursor key mode here.
  
      # Flush output. `disable_mouse_support` needs to write to stdout.
      self.output.flush()
  
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 2 for calling the Renderer obj's underlying member method code with example usage: obj.reset(_scroll, leave_alternate_screen) without return types