diff --git a/example/blessed-telnet.js b/example/blessed-telnet.js index b711306..a8f7279 100755 --- a/example/blessed-telnet.js +++ b/example/blessed-telnet.js @@ -25,6 +25,10 @@ var server = telnet.createServer(function(client) { client.do.window_size(); client.do.environment_variables(); + client.on('debug', function(msg) { + console.error(msg); + }); + client.on('environment variables', function(data) { if (data.command === 'sb' && data.name === 'TERM') { screen.terminal = data.value; diff --git a/lib/program.js b/lib/program.js index 16b8681..6ca0b18 100644 --- a/lib/program.js +++ b/lib/program.js @@ -71,6 +71,8 @@ function Program(options) { || process.env.TERM || (process.platform === 'win32' ? 'windows-ansi' : 'xterm'); + this._terminal = this._terminal.toLowerCase(); + // OSX this.isOSXTerm = process.env.TERM_PROGRAM === 'Apple_Terminal'; this.isiTerm2 = process.env.TERM_PROGRAM === 'iTerm.app' @@ -308,7 +310,7 @@ Program.prototype.__defineSetter__('terminal', function(terminal) { }); Program.prototype.setTerminal = function(terminal) { - this._terminal = terminal; + this._terminal = terminal.toLowerCase(); delete this._tputSetup; this.setupTput(); }; diff --git a/lib/tput.js b/lib/tput.js index 8b99730..5064512 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -46,6 +46,8 @@ function Tput(options) { || process.env.TERM || (process.platform === 'win32' ? 'windows-ansi' : 'xterm'); + this.terminal = this.terminal.toLowerCase(); + this.debug = options.debug; this.padding = options.padding; this.extended = options.extended;