-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Unsupported fd type: TTY #32
Comments
This is really tough. Something really lowlevel must have been changed. I can't even implement my own From what I can see: $ git blame -L 50 lib/net.js
ca5022b8 lib/net.js (Ben Noordhuis 2013-03-14 15:13:58 +0100 50) throw new TypeError('Unsupported fd type: ' + type);
$ git show ca5022b8 nodejs/node-v0.x-archive@ca5022b Not really what I expected. |
We might need to look into using the tty.ReadStream and tty.WriteStream On Friday, March 22, 2013, Christopher Jeffrey wrote:
|
After some testing, it appears |
@chjj I'm playing around with the |
So it looks like a patch as simple as this fixes things: diff --git a/lib/pty.js b/lib/pty.js
index 046a05b..ed3380c 100644
--- a/lib/pty.js
+++ b/lib/pty.js
@@ -5,6 +5,7 @@
*/
var net = require('net');
+var tty = require('tty');
var pty = require('../build/Release/pty.node');
/**
@@ -63,7 +64,7 @@ function Terminal(file, args, opt) {
? pty.fork(file, args, env, cwd, cols, rows, opt.uid, opt.gid)
: pty.fork(file, args, env, cwd, cols, rows);
- this.socket = new net.Socket(term.fd);
+ this.socket = new tty.ReadStream(term.fd);
this.socket.setEncoding('utf8');
this.socket.resume(); However, I don't totally feel like that's the correct fix. I'm beginning work on a more general purpose refactor in the |
Doesn't fix anything for me. I've tried several different ways of reading from that fd. I must be doing something wrong. pty.fork hangs then no data is ever read on node v0.10.1. |
@TooTallNate's quick-fix patch did work for me. |
@chjj fork() doesn't seem to be hanging for me. It takes the same amount of time as always. Did you recompile the module? |
Several times. It builds successfully. I'm not sure what else to try other than to get my hands dirty with some debugging. I'll think I'll do an strace or something. |
Nevermind. I'm a certified idiot today. Problem was completely on my end and the code only made it appear as though |
TooTallNate's patch worked fine for me on ArchLinux . |
Wha? On Sunday, March 24, 2013, yukunyi wrote:
|
TooTallNate's patch worked fine for me on Mac OS X 10.8.3. |
I did a quick fix for this and tagged v0.2.2. @chjj You need to do an |
work on ubuntu 10.04 with node v0.10.1 |
Applying the fix described in issue chjj#32 for a similar issue, which replaces "new net.Socket()" with "new tty.ReadStream()" Signed-off-by: Dan O'Donovan <dan@emutex.com>
Borrowed the fix from here chjj/pty.js#32 (comment)
tip:
net.js:50
throw new TypeError('Unsupported fd type: ' + type);
^
TypeError: Unsupported fd type: TTY
in pty.js:66:17
My System ArchLinux x86_64
nodejs version 0.10.1 or 0.10.0
The text was updated successfully, but these errors were encountered: