Re: [nodejs] opening external editor from node

2012-07-09 Thread Antoine van Wel
On Sun, Jul 8, 2012 at 2:59 PM, Ben Noordhuis wrote: > On Sun, Jul 8, 2012 at 11:54 AM, Antoine van Wel > wrote: >> Hi, >> >> I'm programming a small command-line application and want to open up >> an external editor, and hand back control to node after the user exits >> the editor. Tried opening

Re: [nodejs] opening external editor from node

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 3:18 PM, José F. Romaniello wrote: > I was wondering what if you call exec and the result of the call, which has > stdout, stdin, stderr.. you pipe to the current process stdout, stdin and > stderr: > > var vi = exec("vi... > vi.stdout.pipe(process.stdout) > process.stdin.pi

Re: [nodejs] opening external editor from node

2012-07-08 Thread José F . Romaniello
I was wondering what if you call exec and the result of the call, which has stdout, stdin, stderr.. you pipe to the current process stdout, stdin and stderr: var vi = exec("vi... vi.stdout.pipe(process.stdout) process.stdin.pipe(process.stdin) vi.stderr.pipe(process.stderr) Does this works? Why n

Re: [nodejs] opening external editor from node

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 11:54 AM, Antoine van Wel wrote: > Hi, > > I'm programming a small command-line application and want to open up > an external editor, and hand back control to node after the user exits > the editor. Tried opening up vi with child_process.exec and .spawn but > that did not qu

Re: [nodejs] opening external editor from node

2012-07-08 Thread Antoine van Wel
Awesome, thanks. It required a small patch and now it's working on 0.8.x Antoine On Sun, Jul 8, 2012 at 12:31 PM, Dominic Tarr wrote: > substack has a module that does this > https://github.com/substack/node-editor > > I haven't used it, but someone mentioned it, and this jogged my memory > >

Re: [nodejs] opening external editor from node

2012-07-08 Thread Dominic Tarr
substack has a module that does this https://github.com/substack/node-editor I haven't used it, but someone mentioned it, and this jogged my memory On Sun, Jul 8, 2012 at 10:22 PM, Antoine van Wel wrote: > You are right, when trying to open an editor which actually launches > in a new window wor

Re: [nodejs] opening external editor from node

2012-07-08 Thread Antoine van Wel
You are right, when trying to open an editor which actually launches in a new window works fine. What's not working is when running under Linux from a terminal and try to open up "vi" which would run in the same terminal. I'm guessing all input/output is captured which should not happen here. It r

Re: [nodejs] opening external editor from node

2012-07-08 Thread Angel Java Lopez
I just tried in Node REPL, Windows, and it worked fine. The editor is launched, and when I close the editor (nodepad++), the "and we're back..." message appears. What did you expect? On Sun, Jul 8, 2012 at 6:54 AM, Antoine van Wel wrote: > Hi, > > I'm programming a small command-line application

[nodejs] opening external editor from node

2012-07-08 Thread Antoine van Wel
Hi, I'm programming a small command-line application and want to open up an external editor, and hand back control to node after the user exits the editor. Tried opening up vi with child_process.exec and .spawn but that did not quite do what I expected. 1 var exec = require("child_process").exe