Comparing version 0.10.0-beta7 to 0.10.0-beta8
@@ -268,5 +268,5 @@ "use strict"; | ||
var _this = this; | ||
var _a = process.binding('pipe_wrap'), Pipe = _a.Pipe, constants = _a.constants; // tslint:disable-line | ||
var pipeWrap = process.binding('pipe_wrap'); // tslint:disable-line | ||
// @types/node has fd as string? https://github.com/DefinitelyTyped/DefinitelyTyped/pull/18275 | ||
var handle = new Pipe(constants.SOCKET); | ||
var handle = new pipeWrap.Pipe(pipeWrap.constants.SOCKET); | ||
handle.open(fd); | ||
@@ -273,0 +273,0 @@ _this = _super.call(this, { handle: handle }) || this; |
@@ -78,3 +78,2 @@ "use strict"; | ||
it('should open a pty with access to a master and slave socket', function (done) { | ||
var doneCalled = false; | ||
term = unixTerminal_1.UnixTerminal.open({}); | ||
@@ -81,0 +80,0 @@ var slavebuf = ''; |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.10.0-beta7", | ||
"version": "0.10.0-beta8", | ||
"license": "MIT", | ||
@@ -37,10 +37,11 @@ "main": "./lib/index.js", | ||
"scripts": { | ||
"tsc": "tsc", | ||
"watch": "tsc -w", | ||
"lint": "tslint 'src/**/*.ts'", | ||
"build": "tsc -b ./src/tsconfig.json", | ||
"watch": "tsc -b -w ./src/tsconfig.json", | ||
"lint": "eslint -c .eslintrc.js --ext .ts src/", | ||
"install": "node scripts/install.js", | ||
"postinstall": "node scripts/post-install.js", | ||
"test": "cross-env NODE_ENV=test mocha -R spec --exit lib/*.test.js", | ||
"prepare": "npm run tsc", | ||
"prepublishOnly": "npm run tsc" | ||
"posttest": "npm run lint", | ||
"prepare": "npm run build", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -53,9 +54,10 @@ "dependencies": { | ||
"@types/node": "8", | ||
"@typescript-eslint/eslint-plugin": "^2.27.0", | ||
"@typescript-eslint/parser": "^2.27.0", | ||
"cross-env": "^5.1.4", | ||
"eslint": "^6.8.0", | ||
"mocha": "^7.1.1", | ||
"ps-list": "^6.0.0", | ||
"tslint": "5.12.1", | ||
"tslint-consistent-codestyle": "^1.15.0", | ||
"typescript": "3.4" | ||
"typescript": "^3.8.3" | ||
} | ||
} |
@@ -66,3 +66,3 @@ # node-pty | ||
# Compile TypeScript -> JavaScript | ||
npm run tsc | ||
npm run build | ||
``` | ||
@@ -69,0 +69,0 @@ |
@@ -141,4 +141,4 @@ /** | ||
public setEncoding(encoding: string | null): void { | ||
if ((<any>this._socket)._decoder) { | ||
delete (<any>this._socket)._decoder; | ||
if ((this._socket as any)._decoder) { | ||
delete (this._socket as any)._decoder; | ||
} | ||
@@ -145,0 +145,0 @@ if (encoding) { |
@@ -19,3 +19,3 @@ /** | ||
const term = new UnixTerminal('/bin/bash', [], {}); | ||
let regExp; | ||
let regExp: RegExp; | ||
if (process.platform === 'linux') { | ||
@@ -84,3 +84,2 @@ // https://linux.die.net/man/4/pts | ||
it('should open a pty with access to a master and slave socket', (done) => { | ||
let doneCalled = false; | ||
term = UnixTerminal.open({}); | ||
@@ -130,3 +129,3 @@ | ||
`; | ||
let buffer: string[] = []; | ||
const buffer: string[] = []; | ||
const p = cp.spawn('node', ['-e', data]); | ||
@@ -172,3 +171,3 @@ let sub = ''; | ||
`; | ||
let buffer: string[] = []; | ||
const buffer: string[] = []; | ||
const p = cp.spawn('node', ['-e', data]); | ||
@@ -175,0 +174,0 @@ let sub = ''; |
@@ -78,3 +78,3 @@ /** | ||
const onexit = (code: number, signal: number) => { | ||
const onexit = (code: number, signal: number): void => { | ||
// XXX Sometimes a data event is emitted after exit. Wait til socket is | ||
@@ -197,3 +197,3 @@ // destroyed. | ||
if (encoding !== null) { | ||
self._master.setEncoding(encoding); | ||
self._master.setEncoding(encoding); | ||
} | ||
@@ -204,3 +204,3 @@ self._master.resume(); | ||
if (encoding !== null) { | ||
self._slave.setEncoding(encoding); | ||
self._slave.setEncoding(encoding); | ||
} | ||
@@ -273,16 +273,16 @@ self._slave.resume(); | ||
private _sanitizeEnv(env: IProcessEnv): void { | ||
// Make sure we didn't start our server from inside tmux. | ||
delete env['TMUX']; | ||
delete env['TMUX_PANE']; | ||
// Make sure we didn't start our server from inside tmux. | ||
delete env['TMUX']; | ||
delete env['TMUX_PANE']; | ||
// Make sure we didn't start our server from inside screen. | ||
// http://web.mit.edu/gnu/doc/html/screen_20.html | ||
delete env['STY']; | ||
delete env['WINDOW']; | ||
// Make sure we didn't start our server from inside screen. | ||
// http://web.mit.edu/gnu/doc/html/screen_20.html | ||
delete env['STY']; | ||
delete env['WINDOW']; | ||
// Delete some variables that might confuse our terminal. | ||
delete env['WINDOWID']; | ||
delete env['TERMCAP']; | ||
delete env['COLUMNS']; | ||
delete env['LINES']; | ||
// Delete some variables that might confuse our terminal. | ||
delete env['WINDOWID']; | ||
delete env['TERMCAP']; | ||
delete env['COLUMNS']; | ||
delete env['LINES']; | ||
} | ||
@@ -298,5 +298,5 @@ } | ||
constructor(fd: number) { | ||
const { Pipe, constants } = (<any>process).binding('pipe_wrap'); // tslint:disable-line | ||
const pipeWrap = (<any>process).binding('pipe_wrap'); // tslint:disable-line | ||
// @types/node has fd as string? https://github.com/DefinitelyTyped/DefinitelyTyped/pull/18275 | ||
const handle = new Pipe(constants.SOCKET); | ||
const handle = new pipeWrap.Pipe(pipeWrap.constants.SOCKET); | ||
handle.open(fd); | ||
@@ -303,0 +303,0 @@ super(<any>{ handle }); |
@@ -131,4 +131,3 @@ /** | ||
if (this._useConpty) { | ||
const connect = (this._ptyNative as IConptyNative).connect(this._pty, commandLine, cwd, env, c => this._$onProcessExit(c) | ||
); | ||
const connect = (this._ptyNative as IConptyNative).connect(this._pty, commandLine, cwd, env, c => this._$onProcessExit(c)); | ||
this._innerPid = connect.pid; | ||
@@ -135,0 +134,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1105713
244
3870
9