Bring implementation of XTSAVE and XTRESTORE into line with xterm

Now a stack of depth 1 is used to save/restore private mode values. And
saving/restoring individual modes is supported. This latter is used by
midnight commander.
This commit is contained in:
Kovid Goyal
2021-09-14 21:59:41 +05:30
parent 4c25ceff29
commit 2a8fd278c1
4 changed files with 89 additions and 26 deletions

View File

@@ -92,10 +92,18 @@ def screen_set_mode(x: int, private: bool) -> None:
write(CSI + ('?' if private else '') + str(x) + 'h')
def screen_save_mode(x: int, private: bool) -> None:
write(CSI + ('?' if private else '') + str(x) + 's')
def screen_reset_mode(x: int, private: bool) -> None:
write(CSI + ('?' if private else '') + str(x) + 'l')
def screen_restore_mode(x: int, private: bool) -> None:
write(CSI + ('?' if private else '') + str(x) + 'r')
def screen_set_margins(t: int, b: int) -> None:
write(CSI + '%d;%dr' % (t, b))