simplify attach addon
This commit is contained in:
+4
-5
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user