From 54cbf30c1430eff14cf8e79a4224ef2a6b1aa23d Mon Sep 17 00:00:00 2001 From: teknium1 Date: Tue, 17 Feb 2026 21:34:49 -0800 Subject: [PATCH] Refactor dynamic prompt and layout in HermesCLI - Updated the dynamic prompt to display the Hermes symbol when the agent is active, enhancing user feedback. - Introduced a spacer line in the layout to prevent spinner output from overlapping the input cursor, improving usability. - Adjusted the overall layout to maintain a clean interface while accommodating dynamic elements. --- cli.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cli.py b/cli.py index 6ebbd4ee8..a3196f396 100755 --- a/cli.py +++ b/cli.py @@ -1562,8 +1562,8 @@ class HermesCLI: self._should_exit = True event.app.exit() - # Dynamic prompt: changes to show agent status - cli_ref = self # capture for closure + # Dynamic prompt: shows Hermes symbol when agent is working + cli_ref = self def get_prompt(): if cli_ref._agent_running: @@ -1579,11 +1579,19 @@ class HermesCLI: wrap_lines=False, history=FileHistory(str(self._history_file)), ) + + # Spacer line above input that absorbs spinner output so it + # doesn't overlap the prompt_toolkit cursor + def get_spacer_height(): + return 1 if cli_ref._agent_running else 0 + + spacer = Window(height=get_spacer_height) - # Layout: just the input area, no extra status line + # Layout with dynamic spacer and input at bottom layout = Layout( HSplit([ - Window(height=0), # Spacer that expands + Window(height=0), # Expands to push everything to bottom + spacer, input_area, ]) )