mirror of
https://github.com/tmux/tmux.git
synced 2025-11-24 19:06:07 +00:00
Save and restore images in alternate screen, GitHub issue 3732.
This commit is contained in:
10
screen.c
10
screen.c
@@ -91,6 +91,7 @@ screen_init(struct screen *s, u_int sx, u_int sy, u_int hlimit)
|
|||||||
|
|
||||||
#ifdef ENABLE_SIXEL
|
#ifdef ENABLE_SIXEL
|
||||||
TAILQ_INIT(&s->images);
|
TAILQ_INIT(&s->images);
|
||||||
|
TAILQ_INIT(&s->saved_images);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
s->write_list = NULL;
|
s->write_list = NULL;
|
||||||
@@ -643,6 +644,10 @@ screen_alternate_on(struct screen *s, struct grid_cell *gc, int cursor)
|
|||||||
}
|
}
|
||||||
memcpy(&s->saved_cell, gc, sizeof s->saved_cell);
|
memcpy(&s->saved_cell, gc, sizeof s->saved_cell);
|
||||||
|
|
||||||
|
#ifdef ENABLE_SIXEL
|
||||||
|
TAILQ_CONCAT(&s->saved_images, &s->images, entry);
|
||||||
|
#endif
|
||||||
|
|
||||||
grid_view_clear(s->grid, 0, 0, sx, sy, 8);
|
grid_view_clear(s->grid, 0, 0, sx, sy, 8);
|
||||||
|
|
||||||
s->saved_flags = s->grid->flags;
|
s->saved_flags = s->grid->flags;
|
||||||
@@ -697,6 +702,11 @@ screen_alternate_off(struct screen *s, struct grid_cell *gc, int cursor)
|
|||||||
grid_destroy(s->saved_grid);
|
grid_destroy(s->saved_grid);
|
||||||
s->saved_grid = NULL;
|
s->saved_grid = NULL;
|
||||||
|
|
||||||
|
#ifdef ENABLE_SIXEL
|
||||||
|
image_free_all(s);
|
||||||
|
TAILQ_CONCAT(&s->images, &s->saved_images, entry);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (s->cx > screen_size_x(s) - 1)
|
if (s->cx > screen_size_x(s) - 1)
|
||||||
s->cx = screen_size_x(s) - 1;
|
s->cx = screen_size_x(s) - 1;
|
||||||
if (s->cy > screen_size_y(s) - 1)
|
if (s->cy > screen_size_y(s) - 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user