fix inverse. refactor charAttributes.

This commit is contained in:
Christopher Jeffrey
2013-08-11 04:07:20 -05:00
parent 848a838170
commit 15f6833598
2 changed files with 73 additions and 11 deletions
+11
View File
@@ -15,6 +15,15 @@ var http = require('http')
process.title = 'term.js';
/**
* Dump
*/
var stream;
if (process.argv[2] === '--dump') {
stream = require('fs').createWriteStream(__dirname + '/dump.log');
}
/**
* Open Terminal
*/
@@ -33,6 +42,7 @@ term = pty.fork(process.env.SHELL || 'sh', [], {
});
term.on('data', function(data) {
if (stream) stream.write('OUT: ' + data + '\n-\n');
return !socket
? buff.push(data)
: socket.emit('data', data);
@@ -100,6 +110,7 @@ io.sockets.on('connection', function(sock) {
socket = sock;
socket.on('data', function(data) {
if (stream) stream.write('IN: ' + data + '\n-\n');
term.write(data);
});