aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/termptyesc.c
diff options
context:
space:
mode:
authorArnout Engelen <arnouten@bzzt.net>2016-05-21 14:40:41 +0200
committerArnout Engelen <arnouten@bzzt.net>2016-05-21 14:53:17 +0200
commitef8ee3fbdab5445e2eacf27ed126fcc65f91250e (patch)
tree2c5e3df9995a9fd458463265bb0772bcd149de94 /src/bin/termptyesc.c
parentkey bindings: add shift+left/right to switch tabs (diff)
downloadterminology-ef8ee3fbdab5445e2eacf27ed126fcc65f91250e.tar.gz
Allow font size to be updated via escape sequence
Diffstat (limited to 'src/bin/termptyesc.c')
-rw-r--r--src/bin/termptyesc.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 0daeda4..cd920d1 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -1212,6 +1212,22 @@ err:
return -1;
}
+static void
+_handle_xterm_50_command(Termpty *ty,
+ char *s,
+ int len)
+{
+ int i;
+ int size;
+ for (i = 0; i < len - strlen(":size="); i++)
+ {
+ if (strncmp(s + i, ":size=", strlen(":size=")) == 0)
+ {
+ size = strtol(s + i + strlen(":size="), NULL, 10);
+ termio_font_size_set(ty->obj, size);
+ }
+ }
+}
static void
_handle_xterm_777_command(Termpty *ty EINA_UNUSED,
@@ -1417,6 +1433,17 @@ _handle_esc_xterm(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
#endif
}
break;
+ case 50:
+ DBG("xterm font support");
+ if (!*p)
+ goto err;
+ s = eina_unicode_unicode_to_utf8(p, &len);
+ if (s)
+ {
+ _handle_xterm_50_command(ty, s, len);
+ free(s);
+ }
+ break;
case 777:
DBG("xterm notification support");
s = eina_unicode_unicode_to_utf8(p, &len);