Index: /trunk/termtv/js/parser.js
===================================================================
--- /trunk/termtv/js/parser.js	(revision 17947)
+++ /trunk/termtv/js/parser.js	(revision 17948)
@@ -92,5 +92,5 @@
     // in the loop over the handlabels, but maybe a sequence
     // ot split into to chunks.
-    if (this.buffer.length>50 && this.buffer[0]=='\033')
+    if (this.buffer.length>50 && this.buffer[0]=='\x1b')
     {
         this.debug("Unknown escape sequence: "+
@@ -123,5 +123,5 @@
 
     // ascii // Everything except escape, special chars and 1xxxx xxxx
-    // was: [/^[^\033\007\010\011\012\013\014\015\016\017\x80-\xFF]?/,
+    // was: [/^[^\x1b\007\010\011\012\013\014\015\016\017\x80-\xFF]?/,
     [/^[\x20-\x7F]+/, function (m) {
         this.emu.ev_normalString(m[0]);
@@ -147,5 +147,5 @@
     ////////////////////////////////////////////////////////////////////////////////
     // attributes (colors)
-    [/^\033\[([0-9;]*)m/, function (m) {
+    [/^\x1b\[([0-9;]*)m/, function (m) {
         this.emu.ev_setAttribute(m[1].split(';'));
     }],
@@ -192,36 +192,36 @@
     ////////////////////////////////////////////////////////////////////////////////
     // control characters
-    [/^\007/, function (m) {
+    [/^\x07/, function (m) {
         this.emu.ev_specialChar('bell');
     }],
-    [/^\010/, function (m) {
+    [/^\x08/, function (m) {
         this.emu.ev_specialChar('backspace');
     }],
-    [/^\011/, function (m) {
+    [/^\x09/, function (m) {
         this.emu.ev_specialChar('horizontalTab');
     }],
-    [/^\012/, function (m) {
+    [/^\x0a/, function (m) {
         this.emu.ev_specialChar('lineFeed');
     }],
-    [/^\013/, function (m) {
+    [/^\x0b/, function (m) {
         this.emu.ev_specialChar('verticalTab');
     }],
-    [/^\014/, function (m) {
+    [/^\x0c/, function (m) {
         this.emu.ev_specialChar('formFeed');
     }],
-    [/^\015/, function (m) {
+    [/^\x0d/, function (m) {
         this.emu.ev_specialChar('carriageReturn');
     }],
-    [/^\016/, function (m) {
+    [/^\x0e/, function (m) {
         this.emu.ev_switchCharset('g1');
     }],
-    [/^\017/, function (m) {
+    [/^\x0f/, function (m) {
         this.emu.ev_switchCharset('g0');
     }],
 
-    [/^\033F/, function (m) { // vt52: enter graphics mode
+    [/^\x1bF/, function (m) { // vt52: enter graphics mode
         //this.emu.ev_switchCharset('g0', 'line');
     }],
-    [/^\033G/, function (m) { // vt52: exit graphics mode
+    [/^\x1bG/, function (m) { // vt52: exit graphics mode
         //this.emu.ev_switchCharset('g0', 'us');
     }],
@@ -231,16 +231,16 @@
     // very often used: home and goto
 
-    [/^\033\[[Hf]/, function (m) {
+    [/^\x1b\[[Hf]/, function (m) {
         this.emu.ev_goto( 1, 1 );
     }],
-    [/^\033\[([0-9]*)G/, function (m) {
+    [/^\x1b\[([0-9]*)G/, function (m) {
         this.emu.ev_goto(parseInt(m[1] || '1', 10), -1);  // y=-1 (keep line)
     }],
 
     // cursor set position
-    [/^\033\[([0-9]*);([0-9]*)[Hf]/, function (m) {
+    [/^\x1b\[([0-9]*);([0-9]*)[Hf]/, function (m) {
         this.emu.ev_goto(parseInt(m[2] || '1', 10), parseInt(m[1] || '1', 10));
     }],
-    [/^\033\[([0-9]*)d/, function (m) {
+    [/^\x1b\[([0-9]*)d/, function (m) {
         this.emu.ev_goto(1, parseInt(m[1] || '1', 10));
 
@@ -250,7 +250,7 @@
     // obsolete control characters
 
-    [/^[\000-\006]/, function() { } ],
-    [/^[\020-\032]/, function() { } ],
-    [/^[\034-\037]/, function() { } ],
+    [/^[\x00-\x06]/, function() { } ],
+    [/^[\x10-\x1a]/, function() { } ],
+    [/^[\x1c-\x1f]/, function() { } ],
 /*
     [/^\000/, function (m) {
@@ -326,45 +326,45 @@
 
     // erase in line
-    [/^\033\[0?K/, function (m) {
+    [/^\x1b\[0?K/, function (m) {
         this.emu.ev_eraseInLine('toEnd');
     }],
-    [/^\033\[1K/, function (m) {
+    [/^\x1b\[1K/, function (m) {
         this.emu.ev_eraseInLine('toStart');
     }],
-    [/^\033\[2K/, function (m) {
+    [/^\x1b\[2K/, function (m) {
         this.emu.ev_eraseInLine('whole');
     }],
-    [/^\033K/, function (m) { // vt52
+    [/^\x1bK/, function (m) { // vt52
         this.emu.ev_eraseInLine('toEnd');
     }],
 
     // erase in display 
-    [/^\033\[0?J/, function (m) {
+    [/^\x1b\[0?J/, function (m) {
         this.emu.ev_eraseInDisplay('toEnd');
     }],
-    [/^\033\[1J/, function (m) {
+    [/^\x1b\[1J/, function (m) {
         this.emu.ev_eraseInDisplay('toStart');
     }],
-    [/^\033\[2J/, function (m) {
+    [/^\x1b\[2J/, function (m) {
         this.emu.ev_eraseInDisplay('whole');
     }],
-    [/^\033J/, function (m) { // vt52
+    [/^\x1bJ/, function (m) { // vt52
         this.emu.ev_eraseInDisplay('toEnd');
     }],
 
     // insertion and deletion
-    [/^\033\[([0-9]*)P/, function (m) {
+    [/^\x1b\[([0-9]*)P/, function (m) {
         this.emu.ev_deleteChars(parseInt(m[1] || '1', 10));
     }],
-    [/^\033\[([0-9]*)X/, function (m) {
+    [/^\x1b\[([0-9]*)X/, function (m) {
         this.emu.ev_deleteChars(parseInt(m[1] || '1', 10));
     }],
-    [/^\033\[([0-9]*)L/, function (m) {
+    [/^\x1b\[([0-9]*)L/, function (m) {
         this.emu.ev_insertLines(parseInt(m[1] ||'1', 10));
     }],
-    [/^\033\[([0-9]*)M/, function (m) {
+    [/^\x1b\[([0-9]*)M/, function (m) {
         this.emu.ev_deleteLines(parseInt(m[1] || '1', 10));
     }],
-    [/^\033\[([0-9])*@/, function (m) { // insert N characters
+    [/^\x1b\[([0-9])*@/, function (m) { // insert N characters
        this.emu.ev_insertChars(parseInt(m[1] || '1', 10));
        //this.emu.ev_mode('insertLimited', parseInt(m[1] || '1', 10));
@@ -372,8 +372,8 @@
 
     // margins
-    [/^\033\[([0-9]+);([0-9]+)r/, function (m) {
+    [/^\x1b\[([0-9]+);([0-9]+)r/, function (m) {
         this.emu.ev_setMargins(parseInt(m[1], 10), parseInt(m[2], 10));
     }],
-    [/^\033\[r/, function (m) {
+    [/^\x1b\[r/, function (m) {
         this.emu.ev_resetMargins();
     }],
@@ -385,74 +385,74 @@
     // 6: overline (eterm)
     // 9: strikeout (gnome, guake, nautilus, terminator, xfce4, vte)
-    [/^\033\[\[([0-9;]*)m/, function (m) {
+    [/^\x1b\[\[([0-9;]*)m/, function (m) {
     }],
 
 
     // arrow keys
-    [/^\033\[([0-9]*)A/, function (m) {
+    [/^\x1b\[([0-9]*)A/, function (m) {
         this.emu.ev_arrow('up', parseInt(m[1] || '1', 10));
     }],
-    [/^\033\[([0-9]*)B/, function (m) {
+    [/^\x1b\[([0-9]*)B/, function (m) {
         this.emu.ev_arrow('down', parseInt(m[1] || '1', 10));
     }],
-    [/^\033\[([0-9]*)C/, function (m) {
+    [/^\x1b\[([0-9]*)C/, function (m) {
         this.emu.ev_arrow('right', parseInt(m[1] || '1', 10));
     }],
-    [/^\033\[([0-9]*)D/, function (m) {
+    [/^\x1b\[([0-9]*)D/, function (m) {
         this.emu.ev_arrow('left', parseInt(m[1] || '1', 10));
     }],
-    [/^\033\[([0-9]*)E/, function (m) {
+    [/^\x1b\[([0-9]*)E/, function (m) {
         this.emu.ev_index('nextLine', parseInt(m[1] || '1', 10));
     }],
-    [/^\033\[([0-9]*)F/, function (m) {
+    [/^\x1b\[([0-9]*)F/, function (m) {
         this.emu.ev_index('prevLine', parseInt(m[1] || '1', 10));
     }],
 
-    [/^\033A([\x20-\x7F]?)/, function (m) {  // vt52
+    [/^\x1bA([\x20-\x7F]?)/, function (m) {  // vt52
         this.emu.ev_arrow('up', m[1] ? m[1].charCodeAt(0)-32+1 : 1);
     }],
-    [/^\033B([\x20-\x7F]?)/, function (m) {  // vt52
+    [/^\x1bB([\x20-\x7F]?)/, function (m) {  // vt52
         this.emu.ev_arrow('down', m[1] ? m[1].charCodeAt(0)-32+1 : 1);
     }],
-    [/^\033C([\x20-\x7F]?)/, function (m) {  // vt52
+    [/^\x1bC([\x20-\x7F]?)/, function (m) {  // vt52
         this.emu.ev_arrow('right', m[1] ? m[1].charCodeAt(0)-32+1 : 1);
     }],
-    [/^\033D/, function (m) {  // vt52
+    [/^\x1bD/, function (m) {  // vt52
         this.emu.ev_arrow('left', 1);
     }],
-    [/^\033Y(..)/, function (m) { // vt52
+    [/^\x1bY(..)/, function (m) { // vt52
         this.emu.ev_goto(m[1].charCodeAt(1)-32+1, m[1].charCodeAt(0)-32+1);
     }],
 
-    // vt52: \033I reverse line feed
-    // \033l  move to first line (keep x)
+    // vt52: \x1bI reverse line feed
+    // \x1bl  move to first line (keep x)
 
     // cursor to lower left corner (vt100)
-    //[/^\033F/, function (m) {
+    //[/^\x1bF/, function (m) {
     //}],
 
-    // \033[{n}Z  cursor back tab
-    // \033[{n}I  cursor horizontal tab
-    // \033[{n}W  cursor tab stop control
-    // \033[{n}Y  cursor vertical tab
-    // \033[{n}P  delete character
-    // \033#8     screen alignment display
-    // \033[H     horizontal tab stop
+    // \x1b[{n}Z  cursor back tab
+    // \x1b[{n}I  cursor horizontal tab
+    // \x1b[{n}W  cursor tab stop control
+    // \x1b[{n}Y  cursor vertical tab
+    // \x1b[{n}P  delete character
+    // \x1b#8     screen alignment display
+    // \x1b[H     horizontal tab stop
 
 
     // index and friends
-    [/^\033D/, function (m) {
+    [/^\x1bD/, function (m) {
         this.emu.ev_index('down', 1);
     }],
-    [/^\033M/, function (m) {
+    [/^\x1bM/, function (m) {
         this.emu.ev_index('up', 1);
     }],
-    [/^\033E/, function (m) {
+    [/^\x1bE/, function (m) {
         this.emu.ev_index('nextLine', 1);
     }],
 
 
-    // \033[6] back index
-    // \033[9] forward index
+    // \x1b[6] back index
+    // \x1b[9] forward index
 
     // cursor save/restore
@@ -464,29 +464,29 @@
     //         state of origin mode
     //         state of selective erase
-    [/^\033[7]/, function (m) {
+    [/^\x1b[7]/, function (m) {
         this.emu.ev_cursorStack('push', true);
     }],
-    [/^\033[8]/, function (m) {
+    [/^\x1b[8]/, function (m) {
         this.emu.ev_cursorStack('pop', true);
     }],
     // cursor save/restore position only
-    [/^\033\[s/, function (m) {
+    [/^\x1b\[s/, function (m) {
         this.emu.ev_cursorStack('push', false);
     }],
-    [/^\033\[u/, function (m) {
+    [/^\x1b\[u/, function (m) {
         this.emu.ev_cursorStack('pop', false);
     }],
 
     // keypad
-    [/^\033=/, function (m) {
+    [/^\x1b=/, function (m) {
         this.emu.ev_mode('keypad', 'cursor');
     }],
-    [/^\033>/, function (m) {
+    [/^\x1b>/, function (m) {
         this.emu.ev_mode('keypad', 'numeric');
     }],
 
     // mode set/reset
-    //[/^\033\[(\??)([^\033]*?)h/, function (m) {
-    [/^\033\[(\??)([0-9;]+)h/, function (m) {
+    //[/^\x1b\[(\??)([^\x1b]*?)h/, function (m) {
+    [/^\x1b\[(\??)([0-9;]+)h/, function (m) {
         var me = this;
         m[2].split(';').forEach(function (sub) {
@@ -494,6 +494,6 @@
             });
     }],
-    //[/^\033\[(\??)([^\033]*?)l/, function (m) {
-    [/^\033\[(\??)([0-9;]+)l/, function (m) {
+    //[/^\x1b\[(\??)([^\x1b]*?)l/, function (m) {
+    [/^\x1b\[(\??)([0-9;]+)l/, function (m) {
         var me = this;
         m[2].split(';').forEach(function (sub) {
@@ -502,81 +502,81 @@
     }],
 
-    // curser layout;  '\033[?17;0;0c' hide cursor
-    [/^\033\[\?([0-9;]*)c/, function (m) {
+    // curser layout;  '\x1b[?17;0;0c' hide cursor
+    [/^\x1b\[\?([0-9;]*)c/, function (m) {
         this.debug("cursor layout"+m[1]);
     }],
 
     // horizontal tab stops
-    [/^\033H/, function (m) {
+    [/^\x1bH/, function (m) {
         //this.emu.ev_tabStop('add');    // set a tab stop at the current position
         this.emu.ev_goto( 1, 1);    // vt52: home
     }],
-    [/^\033\[0?g/, function (m) {
+    [/^\x1b\[0?g/, function (m) {
         this.emu.ev_tabStop('remove'); // clear tabs at the current position
     }],
-    [/^\033\[3g/, function (m) {
+    [/^\x1b\[3g/, function (m) {
         this.emu.ev_tabStop('clear');  // clear all tab stops
     }],
 
     // line attributes
-    [/^\033#3/, function (m) {
+    [/^\x1b#3/, function (m) {
         this.emu.ev_lineAttr('dwdhTopHalf');
     }],
-    [/^\033#4/, function (m) {
+    [/^\x1b#4/, function (m) {
         this.emu.ev_lineAttr('dwdhBottomHalf');
     }],
-    [/^\033#5/, function (m) {
+    [/^\x1b#5/, function (m) {
         this.emu.ev_lineAttr('swsh');
     }],
-    [/^\033#6/, function (m) {
+    [/^\x1b#6/, function (m) {
         this.emu.ev_lineAttr('dwsh');
     }],
 
     // erase in area
-    // \033\[0?K    toEnd
-    // \033\[1K     toStart
-    // \033\[2K     whole
+    // \x1b\[0?K    toEnd
+    // \x1b\[1K     toStart
+    // \x1b\[2K     whole
 
     // erase in field
-    // \033\[0?N    toEnd
-    // \033\[1N     toStart
-    // \033\[2N     whole
+    // \x1b\[0?N    toEnd
+    // \x1b\[1N     toStart
+    // \x1b\[2N     whole
 
     // erase character
-    // \033[{N}X
-
-    // \033[{N}T scroll down
-    // \033[{N}S scroll up
-
-
-    // There is \033[?...J as well (erase "selective" in display)
-    // There is \033[?...K as well (erase "selective" in line)
-
-    // \033V Start of guarded area
-    // \033W End of guarded area
-
-    // \033l Lock memory above cursor
-    // \033m Unlock memory above cursor
+    // \x1b[{N}X
+
+    // \x1b[{N}T scroll down
+    // \x1b[{N}S scroll up
+
+
+    // There is \x1b[?...J as well (erase "selective" in display)
+    // There is \x1b[?...K as well (erase "selective" in line)
+
+    // \x1bV Start of guarded area
+    // \x1bW End of guarded area
+
+    // \x1bl Lock memory above cursor
+    // \x1bm Unlock memory above cursor
 
     // reset
-    [/^\033\[!p/, function (m) {
+    [/^\x1b\[!p/, function (m) {
         this.emu.ev_softReset();
     }],
-    [/^\033c/, function (m) {
+    [/^\x1bc/, function (m) {
         this.emu.ev_reset();
     }],
 
     // resize terminal: \e[8;{height};{width}t
-    [/^\033\[([0-9;]*)t/, function (m) {
+    [/^\x1b\[([0-9;]*)t/, function (m) {
     }],
 
     // xterm-style titles
-    [/^\033\]2;([^\033\007]*)\007/, function (m) {
+    [/^\x1b\]2;([^\x1b\x07]*)\x07/, function (m) {
         this.emu.ev_setWindowTitle(m[1]);
     }],
-    [/^\033\]1;([^\033\007]*)\007/, function (m) {
+    [/^\x1b\]1;([^\x1b\x07]*)\x07/, function (m) {
         this.emu.ev_setIconTitle(m[1]);
     }],
-    [/^\033\]0;([^\033\007]*)\007/, function (m) {
+    [/^\x1b\]0;([^\x1b\x07]*)\x07/, function (m) {
         this.emu.ev_setWindowIconTitle(m[1]);
     }],
@@ -588,18 +588,18 @@
     // graphics:       (1, )1, *1, +1  [g0, g1, g2, g3]
     // graphics:       (2, )2, *2, +2  [g0, g1, g2, g3]
-    [/^\033\$?([()*+-./])([ABCEHKQRYZ0124567=])/, function (m) {
+    [/^\x1b\$?([()*+-./])([ABCEHKQRYZ0124567=])/, function (m) {
         this.emu.ev_setCharset(m[1], m[2]);
     }],
 
     // temporary character set
-    [/^\033N(a|[^a])/, function (m) {
+    [/^\x1bN(a|[^a])/, function (m) {
         this.emu.ev_g2char(m[1]);
     }],
-    [/^\033O(a|[^a])/, function (m) {
+    [/^\x1bO(a|[^a])/, function (m) {
         this.emu.ev_g3char(m[1]);
     }],
 
     // reports (skipped, we are not emulating an interactive terminal)
-    [/^\033([0-9;?]*)n/, function (m) {
+    [/^\x1b([0-9;?]*)n/, function (m) {
         /*var me = this;
         m[1].split(';').forEach(function (r) {
@@ -607,13 +607,13 @@
             });*/
     }],
-    [/^\033(\[0?c|Z)/, function (m) {
+    [/^\x1b(\[0?c|Z)/, function (m) {
         //this.emu.ev_report('deviceAttributes');
     }],
-    [/^\033\[>c/, function (m) {
+    [/^\x1b\[>c/, function (m) {
         //this.emu.ev_report('versionString');
     }],
 
     // LEDs
-    [/^\033\[([0-9;]*)q/, function (m) {
+    [/^\x1b\[([0-9;]*)q/, function (m) {
         var me = this;
         (m[1].length ? m[1] : '0').split(';').forEach(function (l) {
@@ -625,22 +625,22 @@
     // Print current screen, 1: print current line,
     // 4: disable log, 5: enable log (echo to printer)
-    [/^\033\[[145]?i/, function (m) {
+    [/^\x1b\[[145]?i/, function (m) {
     }],
 
     //
-    [/^\033\[([0-9;]*)y/, function (m) {
+    [/^\x1b\[([0-9;]*)y/, function (m) {
         this.emu.ev_hardware('selfTestRaw', m[1]);
     }],
-    [/^\033#8/, function (m) {
+    [/^\x1b#8/, function (m) {
         this.emu.ev_hardware('screenAlignment');
     }],
 
     // xterm: select default character set (ISO8859-1)
-    [/^\033%@/, function (m) {
+    [/^\x1b%@/, function (m) {
         //enable utf8?
         //this.cb('mode', 'utf8');
     }],
     // xterm: select default character set (ISO2022)
-    [/^\033%G/, function (m) {
+    [/^\x1b%G/, function (m) {
         //enable utf8?
         //this.cb('mode', 'utf8');
@@ -648,11 +648,11 @@
 
     // screensaver control
-    [/^\033\[9;([0-9]+)\]/, function (m) {
+    [/^\x1b\[9;([0-9]+)\]/, function (m) {
         //this.emu.ev_mode('borderColor', [ m[1], m[2] ]);
-        // \033[9;X]  X in minutes (0 off)
+        // \x1b[9;X]  X in minutes (0 off)
     }],
 
     // My extension to control the 'border color'
-    [/^\033\[([0-9]+)(;[0-9]+)?\xb0/, function (m) {
+    [/^\x1b\[([0-9]+)(;[0-9]+)?\xb0/, function (m) {
         this.emu.ev_mode('borderColor', [ m[1], m[2] ? m[2].substr(1) : null ]);
     }]
Index: /trunk/termtv/js/player.js
===================================================================
--- /trunk/termtv/js/player.js	(revision 17947)
+++ /trunk/termtv/js/player.js	(revision 17948)
@@ -220,5 +220,5 @@
 
         // Scan the data stream for the size sequence
-        var re2 = new RegExp("\033\\[[8];([0-9]+);([0-9]+)t", "g");
+        var re2 = new RegExp("\x1b\\[[8];([0-9]+);([0-9]+)t", "g");
         while (!maxx && !maxy)
         {
@@ -234,5 +234,5 @@
 
         // Scan the data stream for goto sequence if no size sequence was found
-        var re1 = new RegExp("\033\\[([0-9]+);([0-9]+)r", "g");
+        var re1 = new RegExp("\x1b\\[([0-9]+);([0-9]+)r", "g");
         while (1)
         {
@@ -335,5 +335,5 @@
             buffer += This.stream[i].data;
 
-            var re2 = new RegExp("\033\\[[8];([0-9]+);([0-9]+)t", "g");
+            var re2 = new RegExp("\x1b\\[[8];([0-9]+);([0-9]+)t", "g");
             while (1)
             {
@@ -352,5 +352,5 @@
             if (!maxx && !maxy)
             {
-                var re1 = new RegExp("\033\\[([0-9]+);([0-9]+)r", "g");
+                var re1 = new RegExp("\x1b\\[([0-9]+);([0-9]+)r", "g");
                 while (1)
                 {
