mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-01 00:11:39 +08:00
The colored ✓/✗ marks in /tools list, /tools enable, and /tools disable were showing up as "?[32m✓ enabled?[0m" instead of green and red. The colors come out as ANSI escape codes, but the tui eats the ESC byte and replaces it with "?" when those codes are printed straight to stdout. They need to go through prompt_toolkit's renderer. Fix: capture the command's output and re-print each line through _cprint(), the same workaround used elsewhere for #2262. The capture buffer fakes isatty()=True so the color helper still emits escapes (StringIO.isatty() is False, which would otherwise strip colors). The capture path only runs inside the TUI; standalone CLI and tests go straight through to real stdout where colors already work.
473 KiB
473 KiB