From 9c9511429e7cceb5e7e80db26bcc8117a1643fbd Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Fri, 28 Sep 2012 11:12:15 +0000 Subject: [PATCH] terminology: Fix xterm escape termination According to http://rtfm.etla.org/xterm/ctlseq.html xterm Operating System Control escape sequences are terminated by ST or BEL. This fixes #1499 SVN revision: 77198 --- src/bin/termptyesc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index 8499b13c..c7285c39 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -835,19 +835,23 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce) static int _handle_esc_xterm(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce) { - Eina_Unicode *cc; + const Eina_Unicode *cc; Eina_Unicode buf[4096], *b; char *s; int len = 0; - cc = (Eina_Unicode *)c; + cc = c; b = buf; - while ((cc < ce) && (*cc >= ' ') && (*cc < 0x7f)) +#define ST 0x9c // String Terminator +#define BEL 0x07 // Bell + while ((cc < ce) && (*cc != ST) && (*cc != BEL)) { *b = *cc; b++; cc++; } +#undef ST +#undef BEL *b = 0; if ((*cc < ' ') || (*cc >= 0x7f)) cc++; else return -2;