^[control-codes live in libghostty-vt

Control sequences

NP Next Page

Move to another page of display memory, on terminals that have more than one.

CSI Pn U
Defaults
Pn = 1
ECMA-48
§8.3.87 NP – Next Page, p. 51
DEC STD 070
§5.4.7 Next Page, p. 5-77
VT510
NP—Next Page

Some DEC terminals keep several pages of display memory, of which the screen shows one. These five functions move the cursor among them:

SequenceFunctionMoves the cursor to
CSI Pn UNP, next pagethe home position, Pn pages on
CSI Pn VPP, preceding pagethe home position, Pn pages back
CSI Pn SP PPPA, page position absolutethe same line and column on page Pn
CSI Pn SP QPPR, page position relativethe same line and column, Pn pages on
CSI Pn SP RPPB, page position backwardthe same line and column, Pn pages back

That is DEC STD 070’s definition, in §5.4.7 from p. 5-77. A request past the last page goes to the last page, and one before the first goes to the first. ECMA-48 defines NP and PP as showing another page, and says their effect on the cursor “is not defined by this Standard”; its PPA, PPR and PPB are §8.3.96, §8.3.98 and §8.3.97, all on p. 53. The VT510 manual has PP, PPA, PPR and PPB.

DEC STD 070 makes page movement part of levels 3 and 4 only. libghostty-vt has a single page and identifies itself as a level 2 terminal (see DA), so it does not implement any of these, and DEC STD 070 says unimplemented functions “shall be ignored as if they were not received” (§3.5.1.3, p. 3-20). xterm does not implement them either.

Validation

NP-1: Ignored on a level 2 terminal

\e[2;3H
\e[U      # NP
X
|_____|
|__X__|
|_____|
cursor 2,4

NP-2: PP is ignored too

\e[2;3H
\e[V      # PP
X
|_____|
|__X__|
|_____|

NP-3: And the three with an intermediate byte

\e[2;3H
\e[2\sP   # PPA
\e[\sQ    # PPR
\e[\sR    # PPB
X
|_____|
|__X__|
|_____|
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.