code: def sync_with_prompt_toolkit(self):
          
          # After executing a command, make sure that the layout of
          # prompt-toolkit matches our WindowArrangement.
          self.editor_layout.update()
  
          # Make sure that the focus stack of prompt-toolkit has the current
          # page.
          window = self.window_arrangement.active_pt_window
          if window:
              self.application.layout.focus(window)
docs: Update the prompt-toolkit Layout and FocusStack.