Terminal Scrolling Breaks After Large Multi-line Paste Operations
Describe the bug
When pasting large multi-line content (50+ lines) into a reedline-based application, normal terminal scrolling (mouse wheel, trackpad) shows last few lines. Users can only navigate using up/down arrow keys, but cannot scroll through the content naturally.
How to reproduce
Paste any text > 100 lines Scroll using trackpad Yow will be able to see only last few lines of the whole text
Expected behavior
Scroll should work just as up key works.
Configuration
Environment
- reedline version: 0.41.0
- Platform: macOS (also reported on Windows/Linux)
- Terminal: Various (Terminal.app, iTerm2, etc.)
- TERM:
xterm-256color
They key to this issue, which wasn't apparent to me upon reading, is the 100+ lines do not exist in the scroll back buffer after pasting. So, when you scroll back, you see truncated data which, on my system, appears to be truncated at the term size rows.
https://github.com/user-attachments/assets/72080913-bde3-409e-90f9-74c3f086f0ff With bracketed paste enabled (per the video), trackpad scrolling displays only the tail of the paste. pressing Up key shows everything as cursor moves up.
Will share a minimal repro in sometime.
I tested on Windows which doesn't support bracketed paste.