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.
Files changed (42) hide show
  1. package/README.md +5 -4
  2. package/binding.gyp +68 -29
  3. package/lib/conpty_console_list_agent.js.map +1 -1
  4. package/lib/terminal.js +10 -4
  5. package/lib/terminal.js.map +1 -1
  6. package/lib/terminal.test.js +3 -0
  7. package/lib/terminal.test.js.map +1 -1
  8. package/lib/unixTerminal.js +30 -4
  9. package/lib/unixTerminal.js.map +1 -1
  10. package/lib/unixTerminal.test.js +147 -18
  11. package/lib/unixTerminal.test.js.map +1 -1
  12. package/lib/windowsPtyAgent.js +8 -0
  13. package/lib/windowsPtyAgent.js.map +1 -1
  14. package/lib/windowsTerminal.js +21 -3
  15. package/lib/windowsTerminal.js.map +1 -1
  16. package/lib/windowsTerminal.test.js +4 -5
  17. package/lib/windowsTerminal.test.js.map +1 -1
  18. package/lib/worker/conoutSocketWorker.js +3 -0
  19. package/lib/worker/conoutSocketWorker.js.map +1 -1
  20. package/package.json +3 -4
  21. package/scripts/post-install.js +1 -0
  22. package/src/conpty_console_list_agent.ts +1 -1
  23. package/src/interfaces.ts +8 -2
  24. package/src/native.d.ts +3 -1
  25. package/src/terminal.test.ts +3 -0
  26. package/src/terminal.ts +21 -20
  27. package/src/tsconfig.json +1 -3
  28. package/src/unix/pty.cc +297 -205
  29. package/src/unix/spawn-helper.cc +23 -0
  30. package/src/unixTerminal.test.ts +117 -25
  31. package/src/unixTerminal.ts +31 -11
  32. package/src/win/conpty.cc +65 -22
  33. package/src/win/path_util.cc +1 -1
  34. package/src/windowsConoutConnection.ts +1 -1
  35. package/src/windowsPtyAgent.ts +11 -5
  36. package/src/windowsTerminal.test.ts +5 -6
  37. package/src/windowsTerminal.ts +23 -4
  38. package/src/worker/conoutSocketWorker.ts +4 -0
  39. package/typings/node-pty.d.ts +11 -20
  40. package/deps/winpty/.gitignore +0 -15
  41. package/deps/winpty/misc/.gitignore +0 -2
  42. package/scripts/install.js +0 -18
@@ -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, as opened file descriptors
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 THe number of columns to use.
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.
@@ -1,15 +0,0 @@
1
- *.sln
2
- *.suo
3
- *.vcxproj
4
- *.vcxproj.filters
5
- *.pyc
6
- winpty.sdf
7
- winpty.opensdf
8
- /config.mk
9
- /build
10
- /build-gyp
11
- /build-libpty
12
- /ship/packages
13
- /src/Default
14
- /src/Release
15
- /src/gen
@@ -1,2 +0,0 @@
1
- *.exe
2
- UnixEcho
@@ -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
- });