Wow, that was easy, thanks a lot! I ended up using process.stdin.fd, process.stdout.fd and process.stderr.fd instead of 0, 1 and 2 just to avoid magic numbers.
On Monday, March 26, 2012 3:20:27 PM UTC+3, Ben Noordhuis wrote: > > On Mon, Mar 26, 2012 at 09:50, George Miroshnykov > <[email protected]> wrote: > > I'm trying to spawn a vim process from within a node.js CLI script. > > It kinda works piping stdin, stdout and stderr between parent and child > > processes, but there are some bugs: > > 1. I get a couple of warnings like this: > > Vim: Warning: Output is not to a terminal > > Vim: Warning: Input is not from a terminal > > 2. Backspace doesn't work as expected and just types '^?' instead. > > 3. vim window size is smaller than the actual terminal window. > > > > Here's the code: https://gist.github.com/2180730 > > > > I saw a couple of solutions using 'process.binding("stdio")' or > > using customFds, but they don't seem to work (or encouraged) with > > node v0.6.14. > > > > And suggestions/ideas are much appreciated! > > customFds is your best bet. This should work: > > node -e 'require("child_process").spawn("vim", [], {customFds:[0,1,2]})' > > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
