def begin_enter_command()

in src/pathpicker/screen_control.py [0:0]


    def begin_enter_command(self) -> None:
        self.stdscr.erase()
        # first check if they are trying to enter command mode
        # but already have a command...
        if self.flags.get_preset_command():
            self.helper_chrome.output(self.mode)
            (min_x, min_y, _, max_y) = self.get_chrome_boundaries()
            y_start = (max_y + min_y) // 2 - 3
            self.print_provided_command_warning(y_start, min_x)
            self.stdscr.refresh()
            self.get_key()
            self.mode = SELECT_MODE
            self.dirty_all()
            return

        self.mode = COMMAND_MODE
        self.helper_chrome.output(self.mode)
        logger.add_event("enter_command_mode")

        command = self.show_and_get_command()
        if len(command) == 0:
            # go back to selection mode and repaint
            self.mode = SELECT_MODE
            self.curses_api.noecho()
            self.dirty_all()
            logger.add_event("exit_command_mode")
            return
        line_objs = self.get_paths_to_use()
        output.exec_composed_command(command, line_objs)
        sys.exit(0)