always lowercase terminal name. debug messages for blessed-telnet.

This commit is contained in:
Christopher Jeffrey 2015-08-08 15:02:53 -07:00
parent 524a922880
commit f6a19a57e9
3 changed files with 9 additions and 1 deletions

View File

@ -25,6 +25,10 @@ var server = telnet.createServer(function(client) {
client.do.window_size(); client.do.window_size();
client.do.environment_variables(); client.do.environment_variables();
client.on('debug', function(msg) {
console.error(msg);
});
client.on('environment variables', function(data) { client.on('environment variables', function(data) {
if (data.command === 'sb' && data.name === 'TERM') { if (data.command === 'sb' && data.name === 'TERM') {
screen.terminal = data.value; screen.terminal = data.value;

View File

@ -71,6 +71,8 @@ function Program(options) {
|| process.env.TERM || process.env.TERM
|| (process.platform === 'win32' ? 'windows-ansi' : 'xterm'); || (process.platform === 'win32' ? 'windows-ansi' : 'xterm');
this._terminal = this._terminal.toLowerCase();
// OSX // OSX
this.isOSXTerm = process.env.TERM_PROGRAM === 'Apple_Terminal'; this.isOSXTerm = process.env.TERM_PROGRAM === 'Apple_Terminal';
this.isiTerm2 = process.env.TERM_PROGRAM === 'iTerm.app' this.isiTerm2 = process.env.TERM_PROGRAM === 'iTerm.app'
@ -308,7 +310,7 @@ Program.prototype.__defineSetter__('terminal', function(terminal) {
}); });
Program.prototype.setTerminal = function(terminal) { Program.prototype.setTerminal = function(terminal) {
this._terminal = terminal; this._terminal = terminal.toLowerCase();
delete this._tputSetup; delete this._tputSetup;
this.setupTput(); this.setupTput();
}; };

View File

@ -46,6 +46,8 @@ function Tput(options) {
|| process.env.TERM || process.env.TERM
|| (process.platform === 'win32' ? 'windows-ansi' : 'xterm'); || (process.platform === 'win32' ? 'windows-ansi' : 'xterm');
this.terminal = this.terminal.toLowerCase();
this.debug = options.debug; this.debug = options.debug;
this.padding = options.padding; this.padding = options.padding;
this.extended = options.extended; this.extended = options.extended;