aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/termptyesc.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-03-01 17:18:45 +0100
committerBoris Faure <billiob@gmail.com>2015-03-01 17:20:18 +0100
commitb4ba773e17027c160667cd5bd7c9dfaf541ff878 (patch)
tree558a191be2f378740370347e954e8449af3f2bb3 /src/bin/termptyesc.c
parentfont selector: use bg/fg for the preview from config/theme (diff)
downloadterminology-b4ba773e17027c160667cd5bd7c9dfaf541ff878.tar.gz
fix CSI DECSET 1049. Should fix https://phab.enlightenment.org/T725
Diffstat (limited to 'src/bin/termptyesc.c')
-rw-r--r--src/bin/termptyesc.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 56cc215..8452d69 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -110,6 +110,23 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
}
static void
+_switch_to_alternative_screen(Termpty *ty, int mode)
+{
+ DBG("switch to alternative screen, mode:%d", mode);
+ if (ty->altbuf)
+ {
+ // if we are looking at alt buf now,
+ // clear main buf before we swap it back
+ // into the screen2 save (so save is
+ // clear)
+ _termpty_clear_all(ty);
+ }
+ // swap screen content now
+ if (mode != ty->altbuf)
+ termpty_screen_swap(ty);
+}
+
+static void
_handle_esc_csi_reset_mode(Termpty *ty, Eina_Unicode cc, Eina_Unicode *b)
{
int mode = 0, priv = 0, arg;
@@ -290,26 +307,17 @@ _handle_esc_csi_reset_mode(Termpty *ty, Eina_Unicode cc, Eina_Unicode *b)
DBG("Ignored screen mode %i", arg);
break;
case 1047:
- case 1049:
case 47:
- DBG("DDD: switch buf");
- if (ty->altbuf)
- {
- // if we are looking at alt buf now,
- // clear main buf before we swap it back
- // into the screen2 save (so save is
- // clear)
- _termpty_clear_all(ty);
- }
- // swap screen content now
- if (mode != ty->altbuf)
- termpty_screen_swap(ty);
+ _switch_to_alternative_screen(ty, mode);
break;
case 1048:
+ case 1049:
if (mode)
_termpty_cursor_copy(&(ty->state), &(ty->save));
else
_termpty_cursor_copy(&(ty->save), &(ty->state));
+ if (arg == 1049)
+ _switch_to_alternative_screen(ty, mode);
break;
case 2004:
ty->bracketed_paste = mode;