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:
2026-03-22 17:26:14 -07:00
parent e5799a346a
commit bfcad4963a
6 changed files with 257 additions and 21 deletions

View File

@@ -108,6 +108,22 @@ Pipeline effects:
Effect 'repl' set to off
```
## Scrolling Support
The REPL output buffer supports scrolling through command history:
**Keyboard Controls:**
- **PageUp** - Scroll up 10 lines
- **PageDown** - Scroll down 10 lines
- **Mouse wheel up** - Scroll up 3 lines
- **Mouse wheel down** - Scroll down 3 lines
**Scroll Features:**
- **Scroll percentage** shown in HUD (like vim, e.g., "50%")
- **Scroll position** shown in output line (e.g., "(5/20)")
- **Auto-reset** - Scroll resets to bottom when new output arrives
- **Max buffer** - 50 lines (excluding empty lines)
## Notes
- The REPL effect needs a content source to overlay on (e.g., headlines, poetry, empty)