From dfa3c6265c7ed73b29d3d956409210051cc19514 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Tue, 17 Feb 2026 21:33:00 -0800 Subject: [PATCH] Refactor CLI input prompt and layout in HermesCLI - Updated the input area prompt to dynamically reflect agent status, enhancing user feedback during operation. - Removed the status line from the layout to streamline the interface, focusing solely on the input area. - Adjusted styling for prompt states to improve visual clarity and user experience. --- cli.py | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/cli.py b/cli.py index 7d47f507..6ebbd4ee 100755 --- a/cli.py +++ b/cli.py @@ -1562,32 +1562,28 @@ class HermesCLI: self._should_exit = True event.app.exit() + # Dynamic prompt: changes to show agent status + cli_ref = self # capture for closure + + def get_prompt(): + if cli_ref._agent_running: + return [('class:prompt-working', '⚕ ❯ ')] + return [('class:prompt', '❯ ')] + # Create the input area widget with persistent history across sessions input_area = TextArea( height=1, - prompt='❯ ', + prompt=get_prompt, style='class:input-area', multiline=False, wrap_lines=False, history=FileHistory(str(self._history_file)), ) - # Create a status line that shows when agent is working - def get_status_text(): - if self._agent_running: - return [('class:status', ' 🔄 Agent working... (type to interrupt) ')] - return [('class:status', '')] - - status_window = Window( - content=FormattedTextControl(get_status_text), - height=1, - ) - - # Layout with status and input at bottom + # Layout: just the input area, no extra status line layout = Layout( HSplit([ Window(height=0), # Spacer that expands - status_window, input_area, ]) ) @@ -1595,7 +1591,8 @@ class HermesCLI: # Style for the application style = PTStyle.from_dict({ 'input-area': '#FFF8DC', - 'status': 'bg:#333333 #FFD700', + 'prompt': '#FFF8DC', + 'prompt-working': '#888888 italic', }) # Create the application