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 <noreply@anthropic.com>
This commit is contained in:
parent
35b3381b7c
commit
8e98e98bf1
1 changed files with 16 additions and 1 deletions
|
|
@ -191,6 +191,17 @@ class TUIConsole:
|
||||||
"""Handle Ctrl+L - clear output."""
|
"""Handle Ctrl+L - clear output."""
|
||||||
self.output.clear()
|
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)
|
# Page Up/Down scroll output (no focus change needed)
|
||||||
@kb.add("pageup")
|
@kb.add("pageup")
|
||||||
def handle_pageup(event):
|
def handle_pageup(event):
|
||||||
|
|
@ -234,7 +245,10 @@ class TUIConsole:
|
||||||
right_margins=[ScrollbarMargin(display_arrows=True)],
|
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():
|
def get_separator():
|
||||||
name = self.pump.config.name
|
name = self.pump.config.name
|
||||||
width = 60
|
width = 60
|
||||||
|
|
@ -271,6 +285,7 @@ class TUIConsole:
|
||||||
# Main layout
|
# Main layout
|
||||||
root = HSplit([
|
root = HSplit([
|
||||||
self.output_window, # Scrollable output history
|
self.output_window, # Scrollable output history
|
||||||
|
spacer, # Blank line above separator
|
||||||
separator,
|
separator,
|
||||||
input_row,
|
input_row,
|
||||||
])
|
])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue