node-pty 1.2.0-beta.8 → 1.2.0-beta.9
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/lib/unixTerminal.js +5 -2
- package/lib/windowsTerminal.js +1 -1
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/pty.node +0 -0
- package/prebuilds/darwin-arm64/spawn-helper +0 -0
- package/prebuilds/darwin-x64/pty.node +0 -0
- package/prebuilds/darwin-x64/spawn-helper +0 -0
- package/prebuilds/linux-arm64/pty.node +0 -0
- package/prebuilds/linux-x64/pty.node +0 -0
- package/prebuilds/win32-arm64/conpty.node +0 -0
- package/prebuilds/win32-arm64/conpty.pdb +0 -0
- package/prebuilds/win32-arm64/conpty_console_list.node +0 -0
- package/prebuilds/win32-arm64/conpty_console_list.pdb +0 -0
- package/prebuilds/win32-x64/conpty.node +0 -0
- package/prebuilds/win32-x64/conpty.pdb +0 -0
- package/prebuilds/win32-x64/conpty_console_list.node +0 -0
- package/prebuilds/win32-x64/conpty_console_list.pdb +0 -0
- package/src/unix/pty.cc +7 -5
- package/typings/node-pty.d.ts +4 -1
package/lib/unixTerminal.js
CHANGED
|
@@ -246,11 +246,14 @@ var UnixTerminal = /** @class */ (function (_super) {
|
|
|
246
246
|
/**
|
|
247
247
|
* TTY
|
|
248
248
|
*/
|
|
249
|
-
UnixTerminal.prototype.resize = function (cols, rows) {
|
|
249
|
+
UnixTerminal.prototype.resize = function (cols, rows, pixelSize) {
|
|
250
|
+
var _a, _b;
|
|
250
251
|
if (cols <= 0 || rows <= 0 || isNaN(cols) || isNaN(rows) || cols === Infinity || rows === Infinity) {
|
|
251
252
|
throw new Error('resizing must be done using positive cols and rows');
|
|
252
253
|
}
|
|
253
|
-
|
|
254
|
+
var pixelWidth = (_a = pixelSize === null || pixelSize === void 0 ? void 0 : pixelSize.width) !== null && _a !== void 0 ? _a : 0;
|
|
255
|
+
var pixelHeight = (_b = pixelSize === null || pixelSize === void 0 ? void 0 : pixelSize.height) !== null && _b !== void 0 ? _b : 0;
|
|
256
|
+
pty.resize(this._fd, cols, rows, pixelWidth, pixelHeight);
|
|
254
257
|
this._cols = cols;
|
|
255
258
|
this._rows = rows;
|
|
256
259
|
};
|
package/lib/windowsTerminal.js
CHANGED
|
@@ -121,7 +121,7 @@ var WindowsTerminal = /** @class */ (function (_super) {
|
|
|
121
121
|
/**
|
|
122
122
|
* TTY
|
|
123
123
|
*/
|
|
124
|
-
WindowsTerminal.prototype.resize = function (cols, rows) {
|
|
124
|
+
WindowsTerminal.prototype.resize = function (cols, rows, pixelSize) {
|
|
125
125
|
var _this = this;
|
|
126
126
|
if (cols <= 0 || rows <= 0 || isNaN(cols) || isNaN(rows) || cols === Infinity || rows === Infinity) {
|
|
127
127
|
throw new Error('resizing must be done using positive cols and rows');
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/unix/pty.cc
CHANGED
|
@@ -543,11 +543,13 @@ Napi::Value PtyResize(const Napi::CallbackInfo& info) {
|
|
|
543
543
|
Napi::Env env(info.Env());
|
|
544
544
|
Napi::HandleScope scope(env);
|
|
545
545
|
|
|
546
|
-
if (info.Length() !=
|
|
546
|
+
if (info.Length() != 5 ||
|
|
547
547
|
!info[0].IsNumber() ||
|
|
548
548
|
!info[1].IsNumber() ||
|
|
549
|
-
!info[2].IsNumber()
|
|
550
|
-
|
|
549
|
+
!info[2].IsNumber() ||
|
|
550
|
+
!info[3].IsNumber() ||
|
|
551
|
+
!info[4].IsNumber()) {
|
|
552
|
+
throw Napi::Error::New(env, "Usage: pty.resize(fd, cols, rows, xPixel, yPixel)");
|
|
551
553
|
}
|
|
552
554
|
|
|
553
555
|
int fd = info[0].As<Napi::Number>().Int32Value();
|
|
@@ -555,8 +557,8 @@ Napi::Value PtyResize(const Napi::CallbackInfo& info) {
|
|
|
555
557
|
struct winsize winp;
|
|
556
558
|
winp.ws_col = info[1].As<Napi::Number>().Int32Value();
|
|
557
559
|
winp.ws_row = info[2].As<Napi::Number>().Int32Value();
|
|
558
|
-
winp.ws_xpixel =
|
|
559
|
-
winp.ws_ypixel =
|
|
560
|
+
winp.ws_xpixel = info[3].As<Napi::Number>().Int32Value();
|
|
561
|
+
winp.ws_ypixel = info[4].As<Napi::Number>().Int32Value();
|
|
560
562
|
|
|
561
563
|
if (ioctl(fd, TIOCSWINSZ, &winp) == -1) {
|
|
562
564
|
switch (errno) {
|
package/typings/node-pty.d.ts
CHANGED
|
@@ -159,8 +159,11 @@ declare module 'node-pty' {
|
|
|
159
159
|
* Resizes the dimensions of the pty.
|
|
160
160
|
* @param columns The number of columns to use.
|
|
161
161
|
* @param rows The number of rows to use.
|
|
162
|
+
* @param pixelSize Optional pixel dimensions of the pty. On Unix, this sets the `ws_xpixel`
|
|
163
|
+
* and `ws_ypixel` fields of the `winsize` struct. Applications running in the pty can read
|
|
164
|
+
* these values via the `TIOCGWINSZ` ioctl. This parameter is ignored on Windows.
|
|
162
165
|
*/
|
|
163
|
-
resize(columns: number, rows: number): void;
|
|
166
|
+
resize(columns: number, rows: number, pixelSize?: { width: number, height: number }): void;
|
|
164
167
|
|
|
165
168
|
/**
|
|
166
169
|
* Clears the pty's internal representation of its buffer. This is a no-op
|