diff --git a/cli.py b/cli.py index 6b62493d60c35..4de80067800d9 100644 --- a/cli.py +++ b/cli.py @@ -8028,6 +8028,8 @@ def process_command(self, command: str) -> bool: self._handle_skin_command(cmd_original) elif canonical == "voice": self._handle_voice_command(cmd_original) + elif canonical == "indicator": + self._handle_indicator_command(cmd_original) elif canonical == "busy": self._handle_busy_command(cmd_original) else: @@ -9016,6 +9018,44 @@ def _handle_reasoning_command(self, cmd: str): else: _cprint(f" {_ACCENT}✓ Reasoning effort set to '{arg}' (session only){_RST}") + def _handle_indicator_command(self, cmd: str): + """Handle /indicator — pick the TUI busy-indicator style. + + Usage: + /indicator Show current indicator style + /indicator status Show current indicator style + /indicator kaomoji Use animated kaomoji faces (default) + /indicator emoji Use emoji indicator + /indicator unicode Use unicode (braille) spinner + /indicator ascii Use plain ASCII indicator + """ + valid = {"kaomoji", "emoji", "unicode", "ascii"} + try: + cfg = load_cli_config() + current = ((cfg.get("display") if isinstance(cfg, dict) else None) or {}).get( + "tui_status_indicator", "kaomoji" + ) or "kaomoji" + except Exception: + current = "kaomoji" + + parts = cmd.strip().split(maxsplit=1) + if len(parts) < 2 or parts[1].strip().lower() == "status": + _cprint(f" {_ACCENT}Busy indicator style: {current}{_RST}") + _cprint(f" {_DIM}Usage: /indicator [kaomoji|emoji|unicode|ascii|status]{_RST}") + return + + arg = parts[1].strip().lower() + if arg not in valid: + _cprint(f" {_DIM}(._.) Unknown argument: {arg}{_RST}") + _cprint(f" {_DIM}Usage: /indicator [kaomoji|emoji|unicode|ascii|status]{_RST}") + return + + if save_config_value("display.tui_status_indicator", arg): + _cprint(f" {_ACCENT}✓ Busy indicator style set to '{arg}' (saved to config){_RST}") + _cprint(f" {_DIM}Takes effect on next CLI/TUI start.{_RST}") + else: + _cprint(f" {_ACCENT}✓ Busy indicator style set to '{arg}' (session only){_RST}") + def _handle_busy_command(self, cmd: str): """Handle /busy — control what Enter does while Hermes is working. diff --git a/tests/hermes_cli/test_indicator_command.py b/tests/hermes_cli/test_indicator_command.py new file mode 100644 index 0000000000000..7c5711d2d6fe4 --- /dev/null +++ b/tests/hermes_cli/test_indicator_command.py @@ -0,0 +1,79 @@ +"""Regression test for issue #27603: /indicator slash command had no handler. + +The command is defined in COMMAND_REGISTRY but `HermesCLI.process_command()` +did not dispatch it, causing "Unknown command: /indicator