Match save/restore cursor behavior of other terms
For the sake of interoperability. This means that doing a DECRC without a prior DECSC is now undefined. However, one can now issue multiple DECRC for a single DECSC. Fixes #1264
This commit is contained in:
parent
00aba7c646
commit
b00cd5cbc3
@ -38,6 +38,10 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- Fix one ANSI formatting escape code not being removed from the pager history
|
||||
buffer when piping it as plain text (:iss:`3132`)
|
||||
|
||||
- Match the save/restore cursor behavior of other terminals, for the sake of
|
||||
interoperability. This means that doing a DECRC without a prior DECSC is now
|
||||
undefined (:iss:`1264`)
|
||||
|
||||
|
||||
0.19.2 [2020-11-13]
|
||||
-------------------
|
||||
|
||||
@ -149,6 +149,8 @@ void
|
||||
screen_reset(Screen *self) {
|
||||
if (self->linebuf == self->alt_linebuf) screen_toggle_screen_buffer(self, true, true);
|
||||
if (self->overlay_line.is_active) deactivate_overlay_line(self);
|
||||
self->main_savepoint.is_valid = false;
|
||||
self->alt_savepoint.is_valid = false;
|
||||
linebuf_clear(self->linebuf, BLANK_CHAR);
|
||||
historybuf_clear(self->historybuf);
|
||||
clear_hyperlink_pool(self->hyperlink_pool);
|
||||
@ -1096,14 +1098,13 @@ screen_linefeed(Screen *self) {
|
||||
|
||||
void
|
||||
screen_save_cursor(Screen *self) {
|
||||
SavepointBuffer *pts = self->linebuf == self->main_linebuf ? &self->main_savepoints : &self->alt_savepoints;
|
||||
Savepoint *sp;
|
||||
buffer_push(pts, sp);
|
||||
Savepoint *sp = self->linebuf == self->main_linebuf ? &self->main_savepoint : &self->alt_savepoint;
|
||||
cursor_copy_to(self->cursor, &(sp->cursor));
|
||||
sp->mDECOM = self->modes.mDECOM;
|
||||
sp->mDECAWM = self->modes.mDECAWM;
|
||||
sp->mDECSCNM = self->modes.mDECSCNM;
|
||||
COPY_CHARSETS(self, sp);
|
||||
sp->is_valid = true;
|
||||
}
|
||||
|
||||
void
|
||||
@ -1115,10 +1116,8 @@ screen_save_modes(Screen *self) {
|
||||
|
||||
void
|
||||
screen_restore_cursor(Screen *self) {
|
||||
SavepointBuffer *pts = self->linebuf == self->main_linebuf ? &self->main_savepoints : &self->alt_savepoints;
|
||||
Savepoint *sp;
|
||||
buffer_pop(pts, sp);
|
||||
if (sp == NULL) {
|
||||
Savepoint *sp = self->linebuf == self->main_linebuf ? &self->main_savepoint : &self->alt_savepoint;
|
||||
if (!sp->is_valid) {
|
||||
screen_cursor_position(self, 1, 1);
|
||||
screen_reset_mode(self, DECOM);
|
||||
RESET_CHARSETS;
|
||||
|
||||
@ -58,16 +58,10 @@ typedef struct {
|
||||
bool use_latin1;
|
||||
Cursor cursor;
|
||||
bool mDECOM, mDECAWM, mDECSCNM;
|
||||
|
||||
bool is_valid;
|
||||
} Savepoint;
|
||||
|
||||
|
||||
typedef struct {
|
||||
Savepoint buf[SAVEPOINTS_SZ];
|
||||
index_type start_of_data, count;
|
||||
} SavepointBuffer;
|
||||
|
||||
|
||||
typedef struct {
|
||||
ScreenModes buf[SAVEPOINTS_SZ];
|
||||
index_type start_of_data, count;
|
||||
@ -97,7 +91,7 @@ typedef struct {
|
||||
} last_rendered;
|
||||
bool use_latin1, is_dirty, scroll_changed, reload_all_gpu_data;
|
||||
Cursor *cursor;
|
||||
SavepointBuffer main_savepoints, alt_savepoints;
|
||||
Savepoint main_savepoint, alt_savepoint;
|
||||
SavemodesBuffer modes_savepoints;
|
||||
PyObject *callbacks, *test_child;
|
||||
LineBuf *linebuf, *main_linebuf, *alt_linebuf;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user