def run(self, command, application):
        """Open application's history buffer in an editor.

        :type command: list
        :param command: The dot command as a list split
            on whitespace, e.g ``['.foo', 'arg1', 'arg2']``

        :type application: AWSShell
        :param application: The application object.

        """
        all_commands = '\n'.join(
            ['aws ' + h for h in list(application.history)
             if not h.startswith(('.', '!'))])
        with temporary_file('w') as f:
            f.write(all_commands)
            f.flush()
            editor = self._get_editor_command()
            try:
                p = self._popen_cls([editor, f.name])
                p.communicate()
            except __HOLE__:
                self._err.write("Unable to launch editor: %s\n"
                                "You can configure which editor to use by "
                                "exporting the EDITOR environment variable.\n"
                                % editor)
dataset/ETHPy150Open awslabs/aws-shell/awsshell/app.py/EditHandler.run