File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1111import sys
1212from contextlib import suppress
1313from typing import Any
14+ from functools import partial
1415
1516
1617CSI = '\033 ['
@@ -50,10 +51,26 @@ def screen_cursor_forward(amt: int) -> None:
5051 write (CSI + '%sC' % amt )
5152
5253
54+ def screen_save_cursor () -> None :
55+ write ('\x1b 7' )
56+
57+
58+ def screen_restore_cursor () -> None :
59+ write ('\x1b 8' )
60+
61+
5362def screen_cursor_back1 (amt : int ) -> None :
5463 write (CSI + '%sD' % amt )
5564
5665
66+ def screen_save_modes () -> None :
67+ write (CSI + '?s' )
68+
69+
70+ def screen_restore_modes () -> None :
71+ write (CSI + '?r' )
72+
73+
5774def screen_designate_charset (which : int , to : int ) -> None :
5875 w = '()' [int (which )]
5976 t = chr (int (to ))
@@ -161,13 +178,19 @@ def report_device_attributes(mode: int, char: int) -> None:
161178 write (CSI + x + 'c' )
162179
163180
181+ def screen_decsace (mode : int ) -> None :
182+ write (CSI + str (mode ) + '*x' )
183+
184+
164185def write_osc (code : int , string : str = '' ) -> None :
165186 if string :
166187 string = ';' + string
167188 write (OSC + str (code ) + string + '\x07 ' )
168189
169190
170191set_dynamic_color = set_color_table_color = write_osc
192+ screen_push_dynamic_colors = partial (write_osc , 30001 )
193+ screen_pop_dynamic_colors = partial (write_osc , 30101 )
171194
172195
173196def replay (raw : str ) -> None :
You can’t perform that action at this time.
0 commit comments