diff --git a/lib/program.js b/lib/program.js index 0b1e56f..eeb060b 100644 --- a/lib/program.js +++ b/lib/program.js @@ -195,7 +195,7 @@ Program.prototype.setupDump = function() { return data.replace(/[\0\x80\x1b-\x1f\x7f\x01-\x1a]/g, function(ch) { switch (ch) { case '\0': - case '\200': + case '\x80': ch = '@'; break; case '\x1b': @@ -1911,7 +1911,7 @@ Program.prototype.getCursorColor = function(callback) { //Program.prototype.pad = Program.prototype.nul = function() { //if (this.has('pad')) return this.put.pad(); - return this._write('\200'); + return this._write('\x80'); }; Program.prototype.bel = diff --git a/lib/tput.js b/lib/tput.js index 4e4c1f0..37f512f 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -366,7 +366,7 @@ Tput.prototype.parseTerminfo = function(data, file) { o = 0; for (; i < l; i += 2) { v = Tput.numbers[o++]; - if (data[i + 1] === 0377 && data[i] === 0377) { + if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) { info.numbers[v] = -1; } else { info.numbers[v] = (data[i + 1] << 8) | data[i]; @@ -379,7 +379,7 @@ Tput.prototype.parseTerminfo = function(data, file) { o = 0; for (; i < l; i += 2) { v = Tput.strings[o++]; - if (data[i + 1] === 0377 && data[i] === 0377) { + if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) { info.strings[v] = -1; } else { info.strings[v] = (data[i + 1] << 8) | data[i]; @@ -533,7 +533,7 @@ Tput.prototype.parseExtended = function(data) { var _numbers = []; l = i + h.numCount * 2; for (; i < l; i += 2) { - if (data[i + 1] === 0377 && data[i] === 0377) { + if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) { _numbers.push(-1); } else { _numbers.push((data[i + 1] << 8) | data[i]); @@ -544,7 +544,7 @@ Tput.prototype.parseExtended = function(data) { var _strings = []; l = i + h.strCount * 2; for (; i < l; i += 2) { - if (data[i + 1] === 0377 && data[i] === 0377) { + if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) { _strings.push(-1); } else { _strings.push((data[i + 1] << 8) | data[i]); @@ -884,7 +884,7 @@ Tput.prototype._compile = function(info, key, str) { ch = ':'; break; case '0': - ch = '\200'; + ch = '\x80'; break; case 'a': ch = '\x07'; @@ -2098,10 +2098,10 @@ Tput.prototype.detectBrokenACS = function(info) { && process.env.TERMCAP && ~process.env.TERMCAP.indexOf('screen') && ~process.env.TERMCAP.indexOf('hhII00')) { - if (~info.strings.enter_alt_charset_mode.indexOf('\016') - || ~info.strings.enter_alt_charset_mode.indexOf('\017') - || ~info.strings.set_attributes.indexOf('\016') - || ~info.strings.set_attributes.indexOf('\017')) { + if (~info.strings.enter_alt_charset_mode.indexOf('\x0e') + || ~info.strings.enter_alt_charset_mode.indexOf('\x0f') + || ~info.strings.set_attributes.indexOf('\x0e') + || ~info.strings.set_attributes.indexOf('\x0f')) { return true; } } @@ -2280,7 +2280,7 @@ function sprintf(src) { break; case 'c': // char param = isFinite(param) - ? String.fromCharCode(param || 0200) + ? String.fromCharCode(param || parseInt('0200', 8)) : ''; break; }