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
This commit is contained in:
Sebastian Dransfeld 2012-09-28 11:12:15 +00:00
parent bb20618912
commit 9c9511429e
1 changed files with 7 additions and 3 deletions

View File

@ -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;