require('child_process').spawn('less', ['Cakefile'], { stdio: 'inherit' });
在 2011年11月10日星期四 UTC+8上午11:39:43,Stuart Rackham写道: > > Hi > > I want to run an interactive console shell command; wait for the user > to exit; > then continue i.e. the same as if you were running it manually from > the command-line. I just can't figure out how to do it. > > This worked in node v0.4.12, but customFd is now deprecated and > it doesn't work in v0.6.0: > > pager = spawn('less', ['Cakefile'], { > customFds: [process.stdin, process.stdout, process.stderr] > }); > > So I tried an interactive shell (node v0.6.0): > > pager = spawn('/bin/bash', ['-i', '-c', 'less', 'Cakefile']); > > Still doesn't work. > > My platform is Xubuntu 10.04 (32bit), node v0.6.0 built from source. > > Any help would be appreciated (I found a similar post here, but no > satisfactory anwser: > > http://groups.google.com/group/nodejs/browse_thread/thread/14eb4cea5d8b85b1/2c87d208b572d0fa?lnk=gst), > > > > > Cheers, Stuart > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/8f1eaf9a-65f6-41f3-9509-7947bb0bf491%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.