code: def _do_history(self, cmd, args):
          
          if args and args[0] == 'clear':
              readline.clear_history()
              readline.write_history_file(self.history_fname)
          elif args and args[0] == 'clearall':
              readline.clear_history()
              shutil.rmtree(self._temp_dir, ignore_errors = True)
              os.makedirs(os.path.join(self._temp_dir, 'history'))
          else:
              readline.write_history_file(self.history_fname)
              with open(self.history_fname, 'r', encoding = 'utf8') as f:
                  self.stdout.write(f.read())
docs: \
          Display history.
              history             Display history.
              history clear       Clear history.
              history clearall    Clear history for all shells.