Add Windows support and first-class Linux support #946

Merged
merged 32 commits into from Nov 11, 2016
Commits
+5 −5
Split
Next

`child_pty` => `pty.js`

commit 33844425a9fb094cbcd64a596d813ace96c68d40 @matheuss matheuss committed Oct 27, 2016
View
@@ -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"
View
@@ -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,17 +69,17 @@ 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);
}
}
destroy() {
try {
- this.pty.kill('SIGHUP');
+ this.pty.kill();
} catch (err) {
console.error('exit error', err.stack);
}