node-pty proper import

This commit is contained in:
Eugene Pankov 2019-05-24 20:02:22 +02:00
parent 25131a5e92
commit a697e063a6
2 changed files with 4 additions and 5 deletions

View File

@ -2,7 +2,7 @@
module.exports = function patchPTYModule (mod) {
const oldSpawn = mod.spawn
if (mod.patched) {
return mod
return
}
mod.patched = true
mod.spawn = (file, args, opt) => {
@ -51,5 +51,4 @@ module.exports = function patchPTYModule (mod) {
})
return terminal
}
return mod
}

View File

@ -1,7 +1,8 @@
import psNode = require('ps-node')
let nodePTY
import * as fs from 'mz/fs'
import * as os from 'os'
import * as nodePTY from 'node-pty'
import { Observable, Subject } from 'rxjs'
import { first } from 'rxjs/operators'
import { Injectable } from '@angular/core'
@ -322,8 +323,7 @@ export class SessionsService {
constructor (
log: LogService,
) {
nodePTY = require('node-pty')
nodePTY = require('../bufferizedPTY')(nodePTY)
require('../bufferizedPTY')(nodePTY)
this.logger = log.create('sessions')
}