node-pty 0.11.0-beta9 → 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 +5 -4
- package/binding.gyp +68 -29
- package/lib/conpty_console_list_agent.js.map +1 -1
- package/lib/terminal.js +10 -4
- package/lib/terminal.js.map +1 -1
- package/lib/terminal.test.js +3 -0
- package/lib/terminal.test.js.map +1 -1
- package/lib/unixTerminal.js +30 -4
- package/lib/unixTerminal.js.map +1 -1
- package/lib/unixTerminal.test.js +147 -18
- package/lib/unixTerminal.test.js.map +1 -1
- package/lib/windowsPtyAgent.js +8 -0
- package/lib/windowsPtyAgent.js.map +1 -1
- package/lib/windowsTerminal.js +21 -3
- package/lib/windowsTerminal.js.map +1 -1
- package/lib/windowsTerminal.test.js +4 -5
- package/lib/windowsTerminal.test.js.map +1 -1
- package/lib/worker/conoutSocketWorker.js +3 -0
- package/lib/worker/conoutSocketWorker.js.map +1 -1
- package/package.json +3 -4
- package/scripts/post-install.js +1 -0
- package/src/conpty_console_list_agent.ts +1 -1
- package/src/interfaces.ts +8 -2
- package/src/native.d.ts +3 -1
- package/src/terminal.test.ts +3 -0
- package/src/terminal.ts +21 -20
- package/src/tsconfig.json +1 -3
- package/src/unix/pty.cc +297 -205
- package/src/unix/spawn-helper.cc +23 -0
- package/src/unixTerminal.test.ts +117 -25
- package/src/unixTerminal.ts +31 -11
- package/src/win/conpty.cc +65 -22
- package/src/win/path_util.cc +1 -1
- package/src/windowsConoutConnection.ts +1 -1
- package/src/windowsPtyAgent.ts +11 -5
- package/src/windowsTerminal.test.ts +5 -6
- package/src/windowsTerminal.ts +23 -4
- package/src/worker/conoutSocketWorker.ts +4 -0
- package/typings/node-pty.d.ts +11 -20
- package/deps/winpty/.gitignore +0 -15
- package/deps/winpty/misc/.gitignore +0 -2
- package/scripts/install.js +0 -18
package/typings/node-pty.d.ts
CHANGED
|
@@ -78,8 +78,8 @@ declare module 'node-pty' {
|
|
|
78
78
|
|
|
79
79
|
export interface IPtyForkOptions extends IBasePtyForkOptions {
|
|
80
80
|
/**
|
|
81
|
-
* Security warning: use this option with great caution,
|
|
82
|
-
* with higher privileges might leak to the child program.
|
|
81
|
+
* Security warning: use this option with great caution,
|
|
82
|
+
* as opened file descriptors with higher privileges might leak to the child program.
|
|
83
83
|
*/
|
|
84
84
|
uid?: number;
|
|
85
85
|
gid?: number;
|
|
@@ -146,30 +146,21 @@ declare module 'node-pty' {
|
|
|
146
146
|
*/
|
|
147
147
|
readonly onExit: IEvent<{ exitCode: number, signal?: number }>;
|
|
148
148
|
|
|
149
|
-
/**
|
|
150
|
-
* Adds a listener to the data event, fired when data is returned from the pty.
|
|
151
|
-
* @param event The name of the event.
|
|
152
|
-
* @param listener The callback function.
|
|
153
|
-
* @deprecated Use IPty.onData
|
|
154
|
-
*/
|
|
155
|
-
on(event: 'data', listener: (data: string) => void): void;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Adds a listener to the exit event, fired when the pty exits.
|
|
159
|
-
* @param event The name of the event.
|
|
160
|
-
* @param listener The callback function, exitCode is the exit code of the process and signal is
|
|
161
|
-
* the signal that triggered the exit. signal is not supported on Windows.
|
|
162
|
-
* @deprecated Use IPty.onExit
|
|
163
|
-
*/
|
|
164
|
-
on(event: 'exit', listener: (exitCode: number, signal?: number) => void): void;
|
|
165
|
-
|
|
166
149
|
/**
|
|
167
150
|
* Resizes the dimensions of the pty.
|
|
168
|
-
* @param columns
|
|
151
|
+
* @param columns The number of columns to use.
|
|
169
152
|
* @param rows The number of rows to use.
|
|
170
153
|
*/
|
|
171
154
|
resize(columns: number, rows: number): void;
|
|
172
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Clears the pty's internal representation of its buffer. This is a no-op
|
|
158
|
+
* unless on Windows/ConPTY. This is useful if the buffer is cleared on the
|
|
159
|
+
* frontend in order to synchronize state with the backend to avoid ConPTY
|
|
160
|
+
* possibly reprinting the screen.
|
|
161
|
+
*/
|
|
162
|
+
clear(): void;
|
|
163
|
+
|
|
173
164
|
/**
|
|
174
165
|
* Writes data to the pty.
|
|
175
166
|
* @param data The data to write.
|
package/deps/winpty/.gitignore
DELETED
package/scripts/install.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const os = require('os');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const spawn = require('child_process').spawn;
|
|
6
|
-
|
|
7
|
-
const gypArgs = ['rebuild'];
|
|
8
|
-
if (process.env.NODE_PTY_DEBUG) {
|
|
9
|
-
gypArgs.push('--debug');
|
|
10
|
-
}
|
|
11
|
-
const gypProcess = spawn(os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', gypArgs, {
|
|
12
|
-
cwd: path.join(__dirname, '..'),
|
|
13
|
-
stdio: 'inherit'
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
gypProcess.on('exit', function (code) {
|
|
17
|
-
process.exit(code);
|
|
18
|
-
});
|