Socket
Socket
Sign inDemoInstall

node-pty

Package Overview
Dependencies
Maintainers
3
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-pty - npm Package Compare versions

Comparing version 0.10.0 to 0.11.0-beta1

lib/shared/conout.js

1

lib/terminal.js

@@ -164,3 +164,2 @@ "use strict";

Terminal.prototype._close = function () {
this._socket.writable = false;
this._socket.readable = false;

@@ -167,0 +166,0 @@ this.write = function () { };

@@ -13,2 +13,3 @@ "use strict";

var child_process_1 = require("child_process");
var windowsConoutConnection_1 = require("./windowsConoutConnection");
var conptyNative;

@@ -21,3 +22,3 @@ var winptyNative;

*/
var FLUSH_DATA_INTERVAL = 20;
var FLUSH_DATA_INTERVAL = 1000;
/**

@@ -93,5 +94,8 @@ * This agent sits between the WindowsTerminal class and provides a common interface for both conpty

this._outSocket.setEncoding('utf8');
this._outSocket.connect(term.conout, function () {
// TODO: Emit event on agent instead of socket?
// Emit ready event.
// The conout socket must be ready out on another thread to avoid deadlocks
this._conoutSocketWorker = new windowsConoutConnection_1.ConoutConnection(term.conout);
this._conoutSocketWorker.onReady(function () {
_this._conoutSocketWorker.connectSocket(_this._outSocket);
});
this._outSocket.on('connect', function () {
_this._outSocket.emit('ready_datapipe');

@@ -102,3 +106,2 @@ });

this._inSocket.connect(term.conin);
// TODO: Wait for ready event?
if (this._useConpty) {

@@ -147,5 +150,3 @@ var connect = this._ptyNative.connect(this._pty, commandLine, cwd, env, function (c) { return _this._$onProcessExit(c); });

this._inSocket.readable = false;
this._inSocket.writable = false;
this._outSocket.readable = false;
this._outSocket.writable = false;
// Tell the agent to kill the pty, this releases handles to the process

@@ -183,2 +184,3 @@ if (this._useConpty) {

}
this._conoutSocketWorker.dispose();
};

@@ -239,5 +241,3 @@ WindowsPtyAgent.prototype._getConsoleProcessList = function () {

this._inSocket.readable = false;
this._inSocket.writable = false;
this._outSocket.readable = false;
this._outSocket.writable = false;
this._outSocket.destroy();

@@ -244,0 +244,0 @@ };

@@ -7,3 +7,3 @@ {

},
"version": "0.10.0",
"version": "0.11.0-beta1",
"license": "MIT",

@@ -52,3 +52,3 @@ "main": "./lib/index.js",

"@types/mocha": "^7.0.2",
"@types/node": "8",
"@types/node": "12",
"@typescript-eslint/eslint-plugin": "^2.27.0",

@@ -55,0 +55,0 @@ "@typescript-eslint/parser": "^2.27.0",

@@ -80,12 +80,10 @@ # node-pty

### Linux/Ubuntu
Node.JS 12+ or Electron 8+ is required to use `node-pty`.
```
### Linux (apt)
```sh
sudo apt install -y make python build-essential
```
The following are also needed:
- Node.JS 10+
### macOS

@@ -106,3 +104,2 @@

- [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk) - only the "Desktop C++ Apps" components are needed to be installed
- Node.JS 10+

@@ -109,0 +106,0 @@ ## Debugging

@@ -190,3 +190,2 @@ /**

protected _close(): void {
this._socket.writable = false;
this._socket.readable = false;

@@ -193,0 +192,0 @@ this.write = () => {};

@@ -12,2 +12,3 @@ /**

import { fork } from 'child_process';
import { ConoutConnection } from './windowsConoutConnection';

@@ -22,3 +23,3 @@ let conptyNative: IConptyNative;

*/
const FLUSH_DATA_INTERVAL = 20;
const FLUSH_DATA_INTERVAL = 1000;

@@ -37,2 +38,3 @@ /**

private _exitCode: number | undefined;
private _conoutSocketWorker: ConoutConnection;

@@ -121,6 +123,8 @@ private _fd: any;

this._outSocket.setEncoding('utf8');
this._outSocket.connect(term.conout, () => {
// TODO: Emit event on agent instead of socket?
// Emit ready event.
// The conout socket must be ready out on another thread to avoid deadlocks
this._conoutSocketWorker = new ConoutConnection(term.conout);
this._conoutSocketWorker.onReady(() => {
this._conoutSocketWorker.connectSocket(this._outSocket);
});
this._outSocket.on('connect', () => {
this._outSocket.emit('ready_datapipe');

@@ -132,3 +136,2 @@ });

this._inSocket.connect(term.conin);
// TODO: Wait for ready event?

@@ -154,5 +157,3 @@ if (this._useConpty) {

this._inSocket.readable = false;
this._inSocket.writable = false;
this._outSocket.readable = false;
this._outSocket.writable = false;
// Tell the agent to kill the pty, this releases handles to the process

@@ -187,2 +188,3 @@ if (this._useConpty) {

}
this._conoutSocketWorker.dispose();
}

@@ -243,5 +245,3 @@

this._inSocket.readable = false;
this._inSocket.writable = false;
this._outSocket.readable = false;
this._outSocket.writable = false;
this._outSocket.destroy();

@@ -248,0 +248,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc