reedline icon indicating copy to clipboard operation
reedline copied to clipboard

Terminal Scrolling Breaks After Large Multi-line Paste Operations

Open amitksingh1490 opened this issue 3 months ago • 3 comments

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

amitksingh1490 avatar Aug 28 '25 13:08 amitksingh1490

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.

fdncred avatar Aug 28 '25 15:08 fdncred

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.

amitksingh1490 avatar Aug 28 '25 16:08 amitksingh1490

I tested on Windows which doesn't support bracketed paste.

fdncred avatar Aug 28 '25 19:08 fdncred