blessed-telnet: handle env variables.

This commit is contained in:
Christopher Jeffrey 2015-08-06 03:27:18 -07:00
parent a8b1764ec6
commit d7933adfb0
1 changed files with 14 additions and 0 deletions

View File

@ -14,10 +14,24 @@ var fs = require('fs');
var blessed = require('blessed');
var telnet = require('telnet');
process.on('uncaughtException', function(err) {
console.error(err ? err.stack : err + '');
});
var server = telnet.createServer(function(client) {
client.do.transmit_binary();
client.do.terminal_type();
client.do.window_size();
client.do.environment_variables();
client.on('environment variables', function(data) {
if (data.command === 'sb') {
if (data.name === 'TERM') {
screen.terminal = data.value;
screen.render();
}
}
});
client.on('terminal type', function(data) {
// https://tools.ietf.org/html/rfc884