问题
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
回答1:
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 r
likely is from ansi.sys
(see terminal database entry for ansi.sys-old), though an older source is always possible.
来源:https://stackoverflow.com/questions/28986776/ansi-escape-sequence-save-restore-cursor-position-support