From 95fddfb788086d495835948b8503025816e79bc7 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Thu, 18 Jul 2013 10:43:41 -0700 Subject: [PATCH] termemu.js: handle some tmux-produced control sequences. --- termemu.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/termemu.js b/termemu.js index b5eb15b..b2c8855 100644 --- a/termemu.js +++ b/termemu.js @@ -1046,6 +1046,10 @@ var termemu = { } else if (c == 109) { /* m - character attributes */ + if (prefix !== null) { + debug(1, "Unimplemented CSI sequence: " + comstr); + return; + } if (params.length == 0) this.clearAttrs(); for (var i = 0; i < params.length; i++) { @@ -1117,8 +1121,8 @@ var termemu = { else break; } - if (this.comseq[i] != 59) { - debug(1, "Invalid OSC sequence"); + if (i < this.comseq.length && this.comseq[i] != 59) { + debug(1, "Invalid OSC sequence: " + this.comseq.toString()); return; } var codenum = Number(numstr); @@ -1165,7 +1169,11 @@ var termemu = { function dchunk(codes) { var dstr = "Chunk: "; for (var i = 0; i < codes.length; i++) { - if (codes[i] < 32 || (codes[i] >= 127 && codes[i] < 160)) + if (codes[i] == 27) + dstr += "\\e"; + else if (codes[i] == 92) + dstr += "\\\\"; + else if (codes[i] < 32 || (codes[i] >= 127 && codes[i] < 160)) dstr += "\\x" + codes[i].toString(16); else dstr += String.fromCharCode(codes[i]);