code: def leave_command_mode(self, append_to_history=False):
          
          self.previewer.restore()
  
          self.application.layout.focus_last()
          self.application.vi_state.input_mode = InputMode.NAVIGATION
  
          self.command_buffer.reset(append_to_history=append_to_history)
docs: Leave command mode. Focus document window again.