ANSI escape sequence save/restore cursor position support

喜你入骨 提交于 2020-01-03 18:15:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!