SD Scroll Down
Move the contents of the scrolling region down n lines.
CSI Pn T
- Defaults
- Pn = 1
- ECMA-48
- §8.3.113 SD – Scroll Down, p. 59
- DEC STD 070
- §5.5 Pan Up (Scroll Down), p. 5-92
- VT510
- SD—Pan Up
Move the lines of the scrolling region down Pn lines. The bottom Pn lines of the region are lost, and Pn blank lines appear at the top margin. A 0 is taken as 1. The cursor does not move.
Like SU, and unlike IL, SD scrolls the whole scrolling region wherever the cursor is, and with left and right margins set moves only the part of each line between them.
DEC STD 070 and the VT510 manual call it Pan Up: in DEC’s windowing extension it moves the window up a page of display memory taller than the screen, bringing a new line into view at the top, rather than moving any data. The SU page explains the difference. xterm, like libghostty-vt, moves the lines, and documents CSI Ps T as “Scroll down Ps lines”.
xterm also scrolls down for CSI Ps ^, which ECMA-48 assigns to SIMD; that page explains why.
With five parameters, CSI Ps ; Ps ; Ps ; Ps ; Ps T is a different sequence in xterm, XTHIMOUSE, which starts highlight mouse tracking.
Validation
SD-1: Scroll one line
1\r\n2\r\n3\r\n4
\e[2;3H
\e[T
|_____|
|1____|
|2____|
|3____|
cursor 2,3
SD-2: Scroll two lines
1\r\n2\r\n3\r\n4
\e[2T
|_____|
|_____|
|1____|
|2____|
SD-3: The scrolling region, with the cursor outside it
1\r\n2\r\n3\r\n4
\e[2;3r # region is lines 2 and 3; homes the cursor, above it
\e[T
|1____|
|_____|
|2____|
|4____|
cursor 1,1
SD-4: Inside left and right margins
abcde\r\nfghij\r\nklmno\r\npqrst\r\nuvwxy
\e[?69h # allow left and right margins
\e[2;4s # margins at columns 2 and 4
\e[2;3H
\e[2T
|a___e|
|f___j|
|kbcdo|
|pghit|
|ulmny|