fix(cli): honor persisted status bar visibility
This commit is contained in:
@@ -3954,6 +3954,26 @@ def _estimate_tui_input_height(
|
||||
return min(max(visual_lines, 1), max(1, int(max_height or 1)))
|
||||
|
||||
|
||||
def _status_bar_visible_from_display_config(display_config: object) -> bool:
|
||||
"""Return the initial classic-CLI status-bar visibility from display config.
|
||||
|
||||
``display.tui_statusbar`` is the persisted user-facing setting toggled by
|
||||
the TUI/statusbar controls. YAML parses bare ``off`` as ``False``, while
|
||||
older config snapshots or hand edits may use strings such as ``"off"`` or
|
||||
``"hidden"``. Treat those values consistently so a new CLI process does not
|
||||
re-enable a status bar that the user deliberately disabled.
|
||||
"""
|
||||
if not isinstance(display_config, dict):
|
||||
display_config = {}
|
||||
statusbar_config = display_config.get(
|
||||
"statusbar",
|
||||
display_config.get("tui_statusbar", "top"),
|
||||
)
|
||||
if isinstance(statusbar_config, str):
|
||||
return statusbar_config.strip().lower() not in {"0", "false", "hidden", "no", "off"}
|
||||
return statusbar_config is not False
|
||||
|
||||
|
||||
def _collect_query_images(query: str | None, image_arg: str | None = None) -> tuple[str, list[Path]]:
|
||||
"""Collect local image attachments for single-query CLI flows."""
|
||||
message = query or ""
|
||||
@@ -4865,7 +4885,9 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin, CLIBillingMixin):
|
||||
self._voice_barge_phase = None # "generation" or "playback" phase of the last barge trip
|
||||
|
||||
# Status bar visibility (toggled via /statusbar)
|
||||
self._status_bar_visible = True
|
||||
self._status_bar_visible = _status_bar_visible_from_display_config(
|
||||
CLI_CONFIG.get("display") if isinstance(CLI_CONFIG, dict) else None
|
||||
)
|
||||
# Battery read-out in the status bar (toggled via /battery, off by
|
||||
# default). Persisted to display.battery so it survives restarts.
|
||||
self._battery_visible = bool(CLI_CONFIG["display"].get("battery", False))
|
||||
|
||||
Reference in New Issue
Block a user