@lydell/node-pty 1.0.0-beta.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +6 -6
- package/unixTerminal.js +4 -27
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Copyright (c) 2018, Microsoft Corporation (MIT License).
|
|
|
17
17
|
|
|
18
18
|
## Version
|
|
19
19
|
|
|
20
|
-
@lydell/node-pty@1.0.0
|
|
20
|
+
@lydell/node-pty@1.0.0 is based on node-pty@1.1.0-beta13 (commit [391347926a45bb0b9e2c9a9f837adc56592b3c4b](https://github.com/microsoft/node-pty/commit/391347926a45bb0b9e2c9a9f837adc56592b3c4b)).
|
|
21
21
|
|
|
22
22
|
## Prebuilt binaries
|
|
23
23
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@lydell/node-pty",
|
|
3
3
|
"description": "node-pty with prebuilt binaries",
|
|
4
4
|
"author": "Simon Lydell",
|
|
5
|
-
"version": "1.0.0
|
|
5
|
+
"version": "1.0.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./node-pty.d.ts",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"node-addon-api": "^7.1.0"
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"@lydell/node-pty-darwin-x64": "1.0.0
|
|
28
|
-
"@lydell/node-pty-darwin-arm64": "1.0.0
|
|
29
|
-
"@lydell/node-pty-linux-x64": "1.0.0
|
|
30
|
-
"@lydell/node-pty-win32-x64": "1.0.0
|
|
31
|
-
"@lydell/node-pty-win32-arm64": "1.0.0
|
|
27
|
+
"@lydell/node-pty-darwin-x64": "1.0.0",
|
|
28
|
+
"@lydell/node-pty-darwin-arm64": "1.0.0",
|
|
29
|
+
"@lydell/node-pty-linux-x64": "1.0.0",
|
|
30
|
+
"@lydell/node-pty-win32-x64": "1.0.0",
|
|
31
|
+
"@lydell/node-pty-win32-arm64": "1.0.0"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/unixTerminal.js
CHANGED
|
@@ -13,12 +13,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
};
|
|
14
14
|
})();
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
|
|
17
|
-
* Copyright (c) 2012-2015, Christopher Jeffrey (MIT License)
|
|
18
|
-
* Copyright (c) 2016, Daniel Imms (MIT License).
|
|
19
|
-
* Copyright (c) 2018, Microsoft Corporation (MIT License).
|
|
20
|
-
*/
|
|
21
|
-
var net = require("net");
|
|
16
|
+
var tty = require("tty");
|
|
22
17
|
var terminal_1 = require("./terminal");
|
|
23
18
|
var utils_1 = require("./utils");
|
|
24
19
|
var requireBinary_1 = require("./requireBinary");
|
|
@@ -87,7 +82,7 @@ var UnixTerminal = /** @class */ (function (_super) {
|
|
|
87
82
|
};
|
|
88
83
|
// fork
|
|
89
84
|
var term = pty.fork(file, args, parsedEnv, cwd, _this._cols, _this._rows, uid, gid, (encoding === 'utf8'), helperPath, onexit);
|
|
90
|
-
_this._socket = new
|
|
85
|
+
_this._socket = new tty.ReadStream(term.fd);
|
|
91
86
|
if (encoding !== null) {
|
|
92
87
|
_this._socket.setEncoding(encoding);
|
|
93
88
|
}
|
|
@@ -179,12 +174,12 @@ var UnixTerminal = /** @class */ (function (_super) {
|
|
|
179
174
|
var encoding = (opt.encoding === undefined ? 'utf8' : opt.encoding);
|
|
180
175
|
// open
|
|
181
176
|
var term = pty.open(cols, rows);
|
|
182
|
-
self._master = new
|
|
177
|
+
self._master = new tty.ReadStream(term.master);
|
|
183
178
|
if (encoding !== null) {
|
|
184
179
|
self._master.setEncoding(encoding);
|
|
185
180
|
}
|
|
186
181
|
self._master.resume();
|
|
187
|
-
self._slave = new
|
|
182
|
+
self._slave = new tty.ReadStream(term.slave);
|
|
188
183
|
if (encoding !== null) {
|
|
189
184
|
self._slave.setEncoding(encoding);
|
|
190
185
|
}
|
|
@@ -268,21 +263,3 @@ var UnixTerminal = /** @class */ (function (_super) {
|
|
|
268
263
|
return UnixTerminal;
|
|
269
264
|
}(terminal_1.Terminal));
|
|
270
265
|
exports.UnixTerminal = UnixTerminal;
|
|
271
|
-
/**
|
|
272
|
-
* Wraps net.Socket to force the handle type "PIPE" by temporarily overwriting
|
|
273
|
-
* tty_wrap.guessHandleType.
|
|
274
|
-
* See: https://github.com/chjj/pty.js/issues/103
|
|
275
|
-
*/
|
|
276
|
-
var PipeSocket = /** @class */ (function (_super) {
|
|
277
|
-
__extends(PipeSocket, _super);
|
|
278
|
-
function PipeSocket(fd) {
|
|
279
|
-
var _this = this;
|
|
280
|
-
var pipeWrap = process.binding('pipe_wrap'); // tslint:disable-line
|
|
281
|
-
// @types/node has fd as string? https://github.com/DefinitelyTyped/DefinitelyTyped/pull/18275
|
|
282
|
-
var handle = new pipeWrap.Pipe(pipeWrap.constants.SOCKET);
|
|
283
|
-
handle.open(fd);
|
|
284
|
-
_this = _super.call(this, { handle: handle }) || this;
|
|
285
|
-
return _this;
|
|
286
|
-
}
|
|
287
|
-
return PipeSocket;
|
|
288
|
-
}(net.Socket));
|