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
+10 -6
View File
@@ -885,9 +885,11 @@ dispatch_csi(Screen *screen, PyObject DUMP_UNUSED *dump_callback) {
REPORT_COMMAND(screen_save_cursor);
screen_save_cursor(screen);
break;
} else if (start_modifier == '?' && !end_modifier && !num_params) {
REPORT_COMMAND(screen_save_modes);
screen_save_modes(screen);
} else if (start_modifier == '?' && !end_modifier) {
if (!num_params) {
REPORT_COMMAND(screen_save_modes);
screen_save_modes(screen);
} else { SET_MODE(screen_save_mode); }
break;
}
REPORT_ERROR("Unknown CSI s sequence with start and end modifiers: '%c' '%c' and %u parameters", start_modifier, end_modifier, num_params);
@@ -949,9 +951,11 @@ dispatch_csi(Screen *screen, PyObject DUMP_UNUSED *dump_callback) {
if (!start_modifier && !end_modifier) {
// DECSTBM
CALL_CSI_HANDLER2(screen_set_margins, 0, 0);
} else if (start_modifier == '?' && !end_modifier && !num_params) {
REPORT_COMMAND(screen_restore_modes);
screen_restore_modes(screen);
} else if (start_modifier == '?' && !end_modifier) {
if (!num_params) {
REPORT_COMMAND(screen_restore_modes);
screen_restore_modes(screen);
} else { SET_MODE(screen_restore_mode); }
break;
}
REPORT_ERROR("Unknown CSI r sequence with start and end modifiers: '%c' '%c' and %u parameters", start_modifier, end_modifier, num_params);