From 7f29ead1d52d6ad79cf1839d51fba92120419ba6 Mon Sep 17 00:00:00 2001 From: Matheus Fernandes Date: Thu, 27 Oct 2016 10:53:57 -0200 Subject: [PATCH] `child_pty` => `pty.js` --- app/package.json | 2 +- app/session.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/package.json b/app/package.json index 670e63186654..14e71fee37bf 100644 --- a/app/package.json +++ b/app/package.json @@ -11,7 +11,6 @@ "repository": "zeit/hyper", "xo": false, "dependencies": { - "child_pty": "3.0.1", "color": "0.11.3", "convert-css-color-name-to-hex": "0.1.1", "default-shell": "1.0.1", @@ -23,6 +22,7 @@ "mkdirp": "0.5.1", "ms": "0.7.1", "node-fetch": "1.6.3", + "pty.js": "https://github.com/Tyriar/pty.js/tarball/c75c2dcb6dcad83b0cb3ef2ae42d0448fb912642", "semver": "5.3.0", "shell-env": "0.2.0", "uuid": "2.0.2" diff --git a/app/session.js b/app/session.js index 9f75439fdeca..920c5f0e43ad 100644 --- a/app/session.js +++ b/app/session.js @@ -10,7 +10,7 @@ const config = require('./config'); let spawn; try { - spawn = require('child_pty').spawn; + spawn = require('pty.js').spawn; } catch (err) { console.error( 'A native module failed to load. Typically this means ' + @@ -69,9 +69,9 @@ module.exports = class Session extends EventEmitter { this.pty.stdin.write(data); } - resize({cols: columns, rows}) { + resize({cols, rows}) { try { - this.pty.stdout.resize({columns, rows}); + this.pty.stdout.resize(cols, rows); } catch (err) { console.error(err.stack); } @@ -79,7 +79,7 @@ module.exports = class Session extends EventEmitter { destroy() { try { - this.pty.kill('SIGHUP'); + this.pty.kill(); } catch (err) { console.error('exit error', err.stack); }