simplify attach addon

This commit is contained in:
Jörg Breitbart
2019-09-22 22:33:55 +02:00
parent 322565807b
commit d34d1f56cb
6 changed files with 14 additions and 32 deletions
+4 -5
View File
@@ -4,10 +4,9 @@ var os = require('os');
var pty = require('node-pty');
/**
* Whether to use UTF8 binary transport.
* (Must also be switched in client.ts)
* Whether to use binary transport.
*/
const USE_BINARY_UTF8 = false;
const USE_BINARY = true;
function startServer() {
@@ -46,7 +45,7 @@ function startServer() {
rows: rows || 24,
cwd: env.PWD,
env: env,
encoding: USE_BINARY_UTF8 ? null : 'utf8'
encoding: USE_BINARY ? null : 'utf8'
});
console.log('Created terminal with PID: ' + term.pid);
@@ -108,7 +107,7 @@ function startServer() {
}
};
}
const send = USE_BINARY_UTF8 ? bufferUtf8(ws, 5) : buffer(ws, 5);
const send = USE_BINARY ? bufferUtf8(ws, 5) : buffer(ws, 5);
term.on('data', function(data) {
try {