From 8e98e98bf1f32994a34ffe6f37f30d5cbfb05ead Mon Sep 17 00:00:00 2001 From: dullfig Date: Sun, 11 Jan 2026 15:21:07 -0800 Subject: [PATCH] Add command history (Up/Down) and spacer above separator - Up/Down arrows now navigate command history via auto_up/auto_down - Added blank line spacer between output and separator for clarity Co-Authored-By: Claude Opus 4.5 --- agentserver/console/tui_console.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/agentserver/console/tui_console.py b/agentserver/console/tui_console.py index cb34a34..4031076 100644 --- a/agentserver/console/tui_console.py +++ b/agentserver/console/tui_console.py @@ -191,6 +191,17 @@ class TUIConsole: """Handle Ctrl+L - clear output.""" self.output.clear() + # Up/Down for command history + @kb.add("up") + def handle_up(event): + """Previous command in history.""" + self.input_buffer.auto_up() + + @kb.add("down") + def handle_down(event): + """Next command in history.""" + self.input_buffer.auto_down() + # Page Up/Down scroll output (no focus change needed) @kb.add("pageup") def handle_pageup(event): @@ -234,7 +245,10 @@ class TUIConsole: right_margins=[ScrollbarMargin(display_arrows=True)], ) - # Separator line with status (shows scroll hint if not at bottom) + # Blank line spacer above separator + spacer = Window(height=1) + + # Separator line with status def get_separator(): name = self.pump.config.name width = 60 @@ -271,6 +285,7 @@ class TUIConsole: # Main layout root = HSplit([ self.output_window, # Scrollable output history + spacer, # Blank line above separator separator, input_row, ])