🐛 fix(cli): wrap approval preview hints

This commit is contained in:
墨綠BG
2026-06-11 23:05:08 -07:00
committed by Teknium
parent d6df38bb6b
commit 81cdbbddc8
2 changed files with 32 additions and 2 deletions
+8 -2
View File
@@ -9654,7 +9654,10 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin):
# Pre-wrap the mandatory content — command + choices must always render.
cmd_wrapped = _wrap_panel_text(cmd_display, inner_text_width)
if not show_full and "view" in choices and len(cmd_wrapped) > 4:
cmd_wrapped = cmd_wrapped[:3] + ["… (choose Show full command)"]
cmd_wrapped = cmd_wrapped[:3] + _wrap_panel_text(
"… (choose Show full command)",
inner_text_width,
)
# (choice_index, wrapped_line) so we can re-apply selected styling below
choice_wrapped: list[tuple[int, str]] = []
@@ -9704,7 +9707,10 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin):
max_cmd_rows = max(1, available - chrome_rows - len(choice_wrapped))
if len(cmd_wrapped) > max_cmd_rows:
keep = max(1, max_cmd_rows - 1) if max_cmd_rows > 1 else 1
cmd_wrapped = cmd_wrapped[:keep] + ["… (command truncated — use /logs or /debug for full text)"]
cmd_wrapped = cmd_wrapped[:keep] + _wrap_panel_text(
"… (command truncated — use /logs or /debug for full text)",
inner_text_width,
)
# Allocate any remaining rows to description. The extra -1 in full mode
# accounts for the blank separator between choices and description.