# HG changeset patch # User John "Elwin" Edwards # Date 1374169421 25200 # Node ID 144595e50376cf0a8f0159f66dcbd6bc3728b558 # Parent f14e92f6d955e788f83e782188f8e8e26a21dd42 termemu.js: handle some tmux-produced control sequences. diff -r f14e92f6d955 -r 144595e50376 termemu.js --- a/termemu.js Thu Jul 18 10:36:58 2013 -0700 +++ b/termemu.js Thu Jul 18 10:43:41 2013 -0700 @@ -1046,6 +1046,10 @@ } 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 @@ 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 @@ 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]);