mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(tui): /statusbar top = inline above input, not row 0 of the screen
'top' and 'bottom' are positions relative to the input row, not the alt screen viewport: - top (default) → inline above the input, where the bar originally lived (what 'on' used to mean) - bottom → below the input, pinned to the last row - off → hidden Drops the literal top-of-screen placement; 'on' is kept as a backward- compat alias that resolves to 'top' at both the config layer (normalizeStatusBar, _coerce_statusbar) and the slash command.
This commit is contained in:
parent
d55a17bd82
commit
ea32364c96
7 changed files with 60 additions and 41 deletions
|
|
@ -455,18 +455,22 @@ def _write_config_key(key_path: str, value):
|
|||
_save_cfg(cfg)
|
||||
|
||||
|
||||
# Legacy configs stored display.tui_statusbar as a bool. Coerce both bool and
|
||||
# string forms to the string enum so rollouts don't require a manual migration.
|
||||
# Legacy configs stored display.tui_statusbar as a bool; a short-lived
|
||||
# intermediate wrote 'on'. Both forms map to 'top' — the inline position
|
||||
# above the input where the bar originally lived — so users don't need to
|
||||
# migrate by hand.
|
||||
def _coerce_statusbar(raw) -> str:
|
||||
if raw is True:
|
||||
return "on"
|
||||
return "top"
|
||||
if raw is False:
|
||||
return "off"
|
||||
if isinstance(raw, str):
|
||||
s = raw.strip().lower()
|
||||
if s in {"on", "off", "bottom", "top"}:
|
||||
if s == "on":
|
||||
return "top"
|
||||
if s in {"off", "top", "bottom"}:
|
||||
return s
|
||||
return "on"
|
||||
return "top"
|
||||
|
||||
|
||||
def _load_reasoning_config() -> dict | None:
|
||||
|
|
@ -2533,10 +2537,12 @@ def _(rid, params: dict) -> dict:
|
|||
raw = str(value or "").strip().lower()
|
||||
cfg0 = _load_cfg()
|
||||
d0 = cfg0.get("display") if isinstance(cfg0.get("display"), dict) else {}
|
||||
current = _coerce_statusbar(d0.get("tui_statusbar", "on"))
|
||||
current = _coerce_statusbar(d0.get("tui_statusbar", "top"))
|
||||
if raw in ("", "toggle"):
|
||||
nv = "on" if current == "off" else "off"
|
||||
elif raw in ("on", "off", "bottom", "top"):
|
||||
nv = "top" if current == "off" else "off"
|
||||
elif raw == "on":
|
||||
nv = "top"
|
||||
elif raw in ("off", "top", "bottom"):
|
||||
nv = raw
|
||||
else:
|
||||
return _err(rid, 4002, f"unknown statusbar value: {value}")
|
||||
|
|
@ -2659,7 +2665,7 @@ def _(rid, params: dict) -> dict:
|
|||
on = bool(_load_cfg().get("display", {}).get("tui_compact", False))
|
||||
return _ok(rid, {"value": "on" if on else "off"})
|
||||
if key == "statusbar":
|
||||
raw = _load_cfg().get("display", {}).get("tui_statusbar", "on")
|
||||
raw = _load_cfg().get("display", {}).get("tui_statusbar", "top")
|
||||
return _ok(rid, {"value": _coerce_statusbar(raw)})
|
||||
if key == "mtime":
|
||||
cfg_path = _hermes_home / "config.yaml"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue