refactor: unify ScreenTerminal — move from builtins to terminal module by gnodet · Pull Request #1971 · jline/jline3 (original) (raw)

@gnodet @claude

ScreenTerminal's cursor_down/cursor_up clamped the cursor to the scroll region margins even when the cursor was positioned outside the scroll region. This caused the Status display to paint content at wrong rows when a restricted scroll region was active, leaving stale status text at the bottom of the screen (e.g. when transitioning from no-border to border mode).

Fix cursor_down and cursor_up to only clamp within the scroll region boundaries; when the cursor is outside, clamp to the physical screen edges instead, matching VT100/xterm behavior.