| 1234567891011121314151617181920212223242526272829303132 |
- diff --git a/lib/unixTerminal.js b/lib/unixTerminal.js
- index 6966d24..18f1d25 100644
- --- a/lib/unixTerminal.js
- +++ b/lib/unixTerminal.js
- @@ -28,10 +28,23 @@ var terminal_1 = require("./terminal");
- var utils_1 = require("./utils");
- var native = (0, utils_1.loadNativeModule)('pty');
- var pty = native.module;
- -var helperPath = native.dir + '/spawn-helper';
- -helperPath = path.resolve(__dirname, helperPath);
- -helperPath = helperPath.replace('app.asar', 'app.asar.unpacked');
- -helperPath = helperPath.replace('node_modules.asar', 'node_modules.asar.unpacked');
- +// A current external embedded-runtime consumer supplies a non-sibling helper.
- +var helperPath = process.env.DSH_NODE_PTY_SPAWN_HELPER;
- +if (helperPath) {
- + helperPath = path.resolve(helperPath);
- +}
- +else {
- + var executableSibling = process.execPath + '-spawn-helper';
- + if (fs.existsSync(executableSibling)) {
- + helperPath = executableSibling;
- + }
- + else {
- + helperPath = native.dir + '/spawn-helper';
- + helperPath = path.resolve(__dirname, helperPath);
- + helperPath = helperPath.replace('app.asar', 'app.asar.unpacked');
- + helperPath = helperPath.replace('node_modules.asar', 'node_modules.asar.unpacked');
- + }
- +}
- var DEFAULT_FILE = 'sh';
- var DEFAULT_NAME = 'xterm';
- var DESTROY_SOCKET_TIMEOUT_MS = 200;
|