Command-line UI loop. Returns: An exit token of arbitrary type. The token can be None.
(self)
| 555 | self._auto_key_in(existing_command) |
| 556 | |
| 557 | def _ui_loop(self): |
| 558 | """Command-line UI loop. |
| 559 | |
| 560 | Returns: |
| 561 | An exit token of arbitrary type. The token can be None. |
| 562 | """ |
| 563 | |
| 564 | while True: |
| 565 | # Enter history command if pointer is in history (> 0): |
| 566 | if self._command_pointer > 0: |
| 567 | existing_command = self._active_command_history[-self._command_pointer] |
| 568 | else: |
| 569 | existing_command = self._pending_command |
| 570 | self._screen_create_command_textbox(existing_command) |
| 571 | |
| 572 | try: |
| 573 | command, terminator, pending_command_changed = self._get_user_command() |
| 574 | except debugger_cli_common.CommandLineExit as e: |
| 575 | return e.exit_token |
| 576 | |
| 577 | if not command and terminator != self.CLI_TAB_KEY: |
| 578 | continue |
| 579 | |
| 580 | if terminator in self.CLI_CR_KEYS or terminator == curses.KEY_MOUSE: |
| 581 | exit_token = self._dispatch_command(command) |
| 582 | if exit_token is not None: |
| 583 | return exit_token |
| 584 | elif terminator == self.CLI_TAB_KEY: |
| 585 | tab_completed = self._tab_complete(command) |
| 586 | self._pending_command = tab_completed |
| 587 | self._cmd_ptr = 0 |
| 588 | elif pending_command_changed: |
| 589 | self._pending_command = command |
| 590 | |
| 591 | return |
| 592 | |
| 593 | def _get_user_command(self): |
| 594 | """Get user command from UI. |
no test coverage detected