forked from genewildish/Mainline
Add mouse wheel and keyboard scrolling support to REPL
- Add scroll_offset to REPLState (max 50 lines) - Modify _render_repl() to use manual scroll position - Add scroll_output(delta) method for scroll control - Add PageUp/PageDown keyboard support (scroll 10 lines) - Add mouse wheel support via SGR mouse tracking - Update HUD to show scroll percentage (like vim) and position - Reset scroll when new output arrives - Add tests for scroll functionality
This commit is contained in:
@@ -1016,8 +1016,21 @@ def run_pipeline_mode(preset_name: str = "demo", graph_config: str | None = None
|
||||
repl_effect.navigate_history(-1)
|
||||
elif key == "down":
|
||||
repl_effect.navigate_history(1)
|
||||
elif key == "page_up":
|
||||
repl_effect.scroll_output(-10) # Scroll up 10 lines
|
||||
elif key == "page_down":
|
||||
repl_effect.scroll_output(10) # Scroll down 10 lines
|
||||
elif key == "backspace":
|
||||
repl_effect.backspace()
|
||||
elif key.startswith("mouse:"):
|
||||
# Mouse event format: mouse:button:x:y
|
||||
parts = key.split(":")
|
||||
if len(parts) >= 2:
|
||||
button = int(parts[1])
|
||||
if button == 64: # Wheel up
|
||||
repl_effect.scroll_output(-3) # Scroll up 3 lines
|
||||
elif button == 65: # Wheel down
|
||||
repl_effect.scroll_output(3) # Scroll down 3 lines
|
||||
elif len(key) == 1:
|
||||
repl_effect.append_to_command(key)
|
||||
# --- End REPL Input Handling ---
|
||||
|
||||
Reference in New Issue
Block a user