sid_com
sid_com

Reputation: 25117

ANSI escape sequence save/restore cursor position support

Are there any known terminals which support the ANSI escape sequences for cursor keys up, down, forward and back:

CSI n A     Cursor Up
CSI n B     Cursor Down
CSI n C     Cursor Forward
CSI n D     Cursor Back

but don't support the save-cursor-position and restore-cursor-position escape sequences?

CSI s       Save Cursor Position
CSI u       Restore Cursor Position

Upvotes: 6

Views: 6353

Answers (1)

Thomas Dickey
Thomas Dickey

Reputation: 54475

A genuine VT100 (or VT220 for that matter) did not recognize these control sequences for save/restore cursor position. They use (as noted in xterm's control sequences list)

ESC 7     Save Cursor (DECSC).
ESC 8     Restore Cursor (DECRC).

Those are the sc and rc capabilities in terminfo; you may see these listed using

infocmp vt100
infocmp vt220

The origin of CSI s and CSI u likely is from ansi.sys (see terminal database entry for ansi.sys-old), though an older source is always possible.

Upvotes: 15

Related Questions