-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathnode-pty@1.2.0-beta.15.patch
More file actions
32 lines (32 loc) · 1.29 KB
/
Copy pathnode-pty@1.2.0-beta.15.patch
File metadata and controls
32 lines (32 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;