code: def execute_command(self, cmd):
          
          if self.input_mode:
              self.end_input(cmd)
              return
          if cmd.endswith('\n'):
              cmd = cmd[:-1]
          # cls command
          if cmd == 'cls':
              self.clear_terminal()
              return
          self.run_command(cmd)
docs: Execute a command
          cmd: one-line command only, with '\n' at the end