diff --git a/plugins/node_modules/vfs-local/localfs.js b/plugins/node_modules/vfs-local/localfs.js index fc1fc779..bd092721 100644 --- a/plugins/node_modules/vfs-local/localfs.js +++ b/plugins/node_modules/vfs-local/localfs.js @@ -85,15 +85,17 @@ module.exports = function setup(fsOptions) { require("module")._initPaths(); } if (!fsOptions.nopty) { + var modulesPath = fsOptions.nodePath || process.env.HOME + "/.c9/node_modules"; // on darwin trying to load binary for a wrong version crashes the process - [(fsOptions.nodePath || process.env.HOME + "/.c9/node_modules") + "/pty.js", - "pty.js"].some(function(p) { + [modulesPath + "/node-pty-prebuilt", + modulesPath + "/pty.js", + "node-pty-prebuilt", + "pty.js" + ].some(function(p) { try { pty = require(p); return true; - } catch(e) { - console.warn(e, p); - } + } catch(e) {} }); if (!pty) console.warn("unable to initialize pty.js:"); @@ -1685,6 +1687,9 @@ module.exports = function setup(fsOptions) { var proc; try { proc = pty.spawn(path, args, options); + proc.readable = true; + proc.writable = true; + proc.on("error", function(){ // Prevent PTY from throwing an error; // I don't know how to test and the src is funky because