diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-08-09 16:57:49 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-08-09 16:57:49 +0000 |
commit | 05eb4ece4439586096ff7d4edbf1a337460deb2c (patch) | |
tree | efee537b3ee9d786a008ecbecaa4faae5a9a7191 | |
parent | 5840c3e13ae5a5cb4ab5300560915e1a26c29e19 (diff) | |
download | rtmux-05eb4ece4439586096ff7d4edbf1a337460deb2c.tar.gz rtmux-05eb4ece4439586096ff7d4edbf1a337460deb2c.tar.bz2 rtmux-05eb4ece4439586096ff7d4edbf1a337460deb2c.zip |
Sync OpenBSD patchset 223:
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.
-rw-r--r-- | input.c | 10 | ||||
-rw-r--r-- | tmux.h | 4 |
2 files changed, 8 insertions, 6 deletions
@@ -1,4 +1,4 @@ -/* $Id: input.c,v 1.88 2009-07-22 17:46:53 tcunha Exp $ */ +/* $Id: input.c,v 1.89 2009-08-09 16:57:49 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1189,7 +1189,9 @@ input_handle_sequence_sm(struct input_ctx *ictx) wp->saved_grid, 0, s->grid, screen_hsize(s), sy); wp->saved_cx = s->cx; wp->saved_cy = s->cy; - + memcpy(&wp->saved_cell, + &ictx->cell, sizeof wp->saved_cell); + grid_view_clear(s->grid, 0, 0, sx, sy); wp->base.grid->flags &= ~GRID_HISTORY; @@ -1261,7 +1263,7 @@ input_handle_sequence_rm(struct input_ctx *ictx) if (sy > 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( s->grid, screen_hsize(s), wp->saved_grid, 0, sy); s->cx = wp->saved_cx; @@ -1270,6 +1272,7 @@ input_handle_sequence_rm(struct input_ctx *ictx) s->cy = wp->saved_cy; if (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 @@ -1326,7 +1329,6 @@ input_handle_sequence_dsr(struct input_ctx *ictx) break; } } - } void @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.403 2009-08-09 16:48:34 tcunha Exp $ */ +/* $Id: tmux.h,v 1.404 2009-08-09 16:57:49 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -601,7 +601,6 @@ struct input_ctx { struct grid_cell cell; - struct grid_cell saved_cell; u_int saved_cx; u_int saved_cy; @@ -673,6 +672,7 @@ struct window_pane { u_int saved_cx; u_int saved_cy; struct grid *saved_grid; + struct grid_cell saved_cell; const struct window_mode *mode; void *modedata; |