mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Using the alternative screen (smcup/rmcup) should also preserve the current
colours and attributes. Found thanks to a report from Taylor Venable. While here also nuke a couple of extra blank lines.
This commit is contained in:
parent
746fe5832a
commit
04e97e8aef
6
input.c
6
input.c
@ -1189,6 +1189,8 @@ input_handle_sequence_sm(struct input_ctx *ictx)
|
|||||||
wp->saved_grid, 0, s->grid, screen_hsize(s), sy);
|
wp->saved_grid, 0, s->grid, screen_hsize(s), sy);
|
||||||
wp->saved_cx = s->cx;
|
wp->saved_cx = s->cx;
|
||||||
wp->saved_cy = s->cy;
|
wp->saved_cy = s->cy;
|
||||||
|
memcpy(&wp->saved_cell,
|
||||||
|
&ictx->cell, sizeof wp->saved_cell);
|
||||||
|
|
||||||
grid_view_clear(s->grid, 0, 0, sx, sy);
|
grid_view_clear(s->grid, 0, 0, sx, sy);
|
||||||
|
|
||||||
@ -1261,7 +1263,7 @@ input_handle_sequence_rm(struct input_ctx *ictx)
|
|||||||
if (sy > wp->saved_grid->sy)
|
if (sy > wp->saved_grid->sy)
|
||||||
screen_resize(s, sx, wp->saved_grid->sy);
|
screen_resize(s, sx, wp->saved_grid->sy);
|
||||||
|
|
||||||
/* Restore the grid and cursor position. */
|
/* Restore the grid, cursor position and cell. */
|
||||||
grid_duplicate_lines(
|
grid_duplicate_lines(
|
||||||
s->grid, screen_hsize(s), wp->saved_grid, 0, sy);
|
s->grid, screen_hsize(s), wp->saved_grid, 0, sy);
|
||||||
s->cx = wp->saved_cx;
|
s->cx = wp->saved_cx;
|
||||||
@ -1270,6 +1272,7 @@ input_handle_sequence_rm(struct input_ctx *ictx)
|
|||||||
s->cy = wp->saved_cy;
|
s->cy = wp->saved_cy;
|
||||||
if (s->cy > screen_size_y(s) - 1)
|
if (s->cy > screen_size_y(s) - 1)
|
||||||
s->cy = screen_size_y(s) - 1;
|
s->cy = screen_size_y(s) - 1;
|
||||||
|
memcpy(&ictx->cell, &wp->saved_cell, sizeof ictx->cell);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Turn history back on (so resize can use it) and then
|
* Turn history back on (so resize can use it) and then
|
||||||
@ -1326,7 +1329,6 @@ input_handle_sequence_dsr(struct input_ctx *ictx)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
2
tmux.h
2
tmux.h
@ -602,7 +602,6 @@ struct input_ctx {
|
|||||||
|
|
||||||
struct grid_cell cell;
|
struct grid_cell cell;
|
||||||
|
|
||||||
|
|
||||||
struct grid_cell saved_cell;
|
struct grid_cell saved_cell;
|
||||||
u_int saved_cx;
|
u_int saved_cx;
|
||||||
u_int saved_cy;
|
u_int saved_cy;
|
||||||
@ -674,6 +673,7 @@ struct window_pane {
|
|||||||
u_int saved_cx;
|
u_int saved_cx;
|
||||||
u_int saved_cy;
|
u_int saved_cy;
|
||||||
struct grid *saved_grid;
|
struct grid *saved_grid;
|
||||||
|
struct grid_cell saved_cell;
|
||||||
|
|
||||||
const struct window_mode *mode;
|
const struct window_mode *mode;
|
||||||
void *modedata;
|
void *modedata;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user