fixing banner formatting issues

when Unix hosts use lf vs cr/lf it doesn’t quite format right.
converting these to fix that. I’m not sure if this is something to be
solved in xterm.js, haven’t had time really review it.
This commit is contained in:
billchurch 2017-02-01 18:36:05 -05:00
parent 8a96240cd3
commit 1725cdaa85

View file

@ -59,8 +59,10 @@ app.use(express.static(__dirname + '/public')).use(function(req, res, next) {
io.on('connection', function(socket) {
var conn = new ssh();
conn.on('banner', function(msg, lng) {
socket.emit('data', msg);
conn.on('banner', function(d) {
//need to convert to cr/lf for proper formatting
d = d.replace(/\n/g, "\r\n");
socket.emit('data', d.toString('binary'));
}).on('ready', function() {
socket.emit('title', 'ssh://' + config.ssh.host);
socket.emit('headerBackground', config.header.background);