code: def _fix_unecessary_blank_lines(ps: PromptSession) -> None:
      
  
      default_container = ps.layout.container
  
      default_buffer_window = \
          default_container.get_children()[0].content.get_children()[1].content
  
      assert isinstance(default_buffer_window, Window)
      # this forces the main window to stay as small as possible, avoiding
      # empty lines in selections
      default_buffer_window.dont_extend_height = Always()
docs: This is a fix for additional empty lines added by prompt toolkit.
  
      This assumes the layout of the default session doesn't change, if it
      does, this needs an update.