summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-03-17 17:15:50 +0100
committerBoris Faure <billiob@gmail.com>2015-03-17 17:15:50 +0100
commit7edeea350332427b1045e79a457cddb2e6f812bc (patch)
tree119efe1dd295922ef9aa6c455101695896b057f2 /src
parent213417195d3d8a87b7a3ab03dca3be0ef16ad766 (diff)
correctly swap term states. Ref T725
Diffstat (limited to 'src')
-rw-r--r--src/bin/termpty.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index f4271a9..ad3ab81 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -1101,15 +1101,24 @@ termpty_screen_swap(Termpty *ty)
1101{ 1101{
1102 Termcell *tmp_screen; 1102 Termcell *tmp_screen;
1103 int tmp_circular_offset; 1103 int tmp_circular_offset;
1104 Termstate tmp;
1104 1105
1105 tmp_screen = ty->screen; 1106 tmp_screen = ty->screen;
1106 ty->screen = ty->screen2; 1107 ty->screen = ty->screen2;
1107 ty->screen2 = tmp_screen; 1108 ty->screen2 = tmp_screen;
1108 1109
1109 if (ty->altbuf) 1110 if (ty->altbuf)
1110 ty->state = ty->swap; 1111 {
1112 tmp = ty->state;
1113 ty->state = ty->swap;
1114 ty->swap = tmp;
1115 }
1111 else 1116 else
1112 ty->swap = ty->state; 1117 {
1118 tmp = ty->swap;
1119 ty->swap = ty->state;
1120 ty->state = tmp;
1121 }
1113 1122
1114 tmp_circular_offset = ty->circular_offset; 1123 tmp_circular_offset = ty->circular_offset;
1115 ty->circular_offset = ty->circular_offset2; 1124 ty->circular_offset = ty->circular_offset2;