diff options
author | 2011-12-27 14:06:19 +0000 | |
---|---|---|
committer | 2011-12-27 14:06:19 +0000 | |
commit | dbbae13b85ef08e8cbe42612082d45cf1118468e (patch) | |
tree | 7072c48ac805227c6835e9ead89f59d315d0cde7 /usr.bin/tmux/input.c | |
parent | Move some global variables/statics to locals, from Michael W (diff) | |
download | wireguard-openbsd-dbbae13b85ef08e8cbe42612082d45cf1118468e.tar.xz wireguard-openbsd-dbbae13b85ef08e8cbe42612082d45cf1118468e.zip |
Add \033[s and \033[u to save and restore cursor position.
Diffstat (limited to 'usr.bin/tmux/input.c')
-rw-r--r-- | usr.bin/tmux/input.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c index 391c654344b..a1ffafa458d 100644 --- a/usr.bin/tmux/input.c +++ b/usr.bin/tmux/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.41 2011/10/23 10:16:14 nicm Exp $ */ +/* $OpenBSD: input.c,v 1.42 2011/12/27 14:06:19 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -135,8 +135,10 @@ enum input_csi_type { INPUT_CSI_HPA, INPUT_CSI_ICH, INPUT_CSI_IL, + INPUT_CSI_RCP, INPUT_CSI_RM, INPUT_CSI_RM_PRIVATE, + INPUT_CSI_SCP, INPUT_CSI_SGR, INPUT_CSI_SM, INPUT_CSI_SM_PRIVATE, @@ -171,6 +173,8 @@ const struct input_table_entry input_csi_table[] = { { 'n', "", INPUT_CSI_DSR }, { 'q', " ", INPUT_CSI_DECSCUSR }, { 'r', "", INPUT_CSI_DECSTBM }, + { 's', "", INPUT_CSI_SCP }, + { 'u', "", INPUT_CSI_RCP }, }; /* Input transition. */ @@ -1168,6 +1172,10 @@ input_csi_dispatch(struct input_ctx *ictx) case INPUT_CSI_IL: screen_write_insertline(sctx, input_get(ictx, 0, 1, 1)); break; + case INPUT_CSI_RCP: + memcpy(&ictx->cell, &ictx->old_cell, sizeof ictx->cell); + screen_write_cursormove(sctx, ictx->old_cx, ictx->old_cy); + break; case INPUT_CSI_RM: switch (input_get(ictx, 0, 0, -1)) { case 4: /* IRM */ @@ -1207,6 +1215,11 @@ input_csi_dispatch(struct input_ctx *ictx) break; } break; + case INPUT_CSI_SCP: + memcpy(&ictx->old_cell, &ictx->cell, sizeof ictx->old_cell); + ictx->old_cx = s->cx; + ictx->old_cy = s->cy; + break; case INPUT_CSI_SGR: input_csi_dispatch_sgr(ictx); break; |