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.
Support
| Terminal | Version | Support | Notes |
|---|---|---|---|
| VT220 | manual, 2nd ed., 1984 | No | not in the manual |
| VT510 | manual, 1st ed., 1993 | Yes | SD—Pan Up: pans the window rather than moving lines |
| xterm | patch 412, xterm-411a | Yes | |
| libghostty-vt | 0f171f6 | Yes | |
| kitty | 0.49.1, run in a VM | Partly | fails SD-4 of the 4 cases that show it working |
| foot | 1.28.0, run in a VM | Partly | fails SD-4 of the 4 cases that show it working |
| pyte | 0.8.2, run as a library | No | fails the 4 cases that show it working |
| xterm.js headless | 6.0.0, run as a library | Partly | fails SD-4 of the 4 cases that show it working |
| alacritty_terminal | 0.26.0, run as a library | Partly | fails SD-4 of the 4 cases that show it working |
| ConEmu | build 230724, its documentation | Partly | scrolls the whole buffer down, not the scrolling region; ANSI escape codes |
| rxvt-unicode | 9.31, run in a VM | Partly | fails SD-4 of the 4 cases that show it working |
| VTE | 0.84.1, run as a library | Yes | passes the 4 cases that show it working |
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|