Skip to content

Comments

'inherit' rather than 'pipe' stdio streams#36

Open
lorenzogrv wants to merge 2 commits intoDTrejo:masterfrom
lorenzogrv:master
Open

'inherit' rather than 'pipe' stdio streams#36
lorenzogrv wants to merge 2 commits intoDTrejo:masterfrom
lorenzogrv:master

Conversation

@lorenzogrv
Copy link

This commit is intended to be a report and a suggestion, I'm not versed about this utility neither about your plans on improving it.

I've found useful to run the child giving it direct access to parent's stdio streams (through 'inherit') rather than piping them.

I was developing an interactive command line utility that makes use of process.stdin.setRawMode so I needed access to the tty stream in the child.

With this little change runjs runs perfectly as expected. My cli thinks it's executed directly on a terminal, and each time a file is modified the cli is restarted.

With the bind to 'exit' event, when the cli process finishes the runjs process finishes too, so there's no need of killing it manually with Ctrl^C.

Congratulations for this tool and its clean code, a quick read allowed me to know where I had to type.

Cheers
L.

This commit is intended to be a report and a suggestion, I'm not versed about this utility neither about your plans on improving it.

I've found useful to run the child giving it direct access to parent's stdio streams (through 'inherit') rather than piping them.

I was developing an interactive command line utility that makes use of `process.stdin.setRawMode` so I needed access to the tty stream in the child.

With this little change `runjs` runs perfectly as expected. My cli thinks it's executed directly on a terminal, and each time a file is modified the cli is restarted.

With the bind to 'exit' event, when the cli process finishes the runjs process finishes too, so there's no need of killing it manually with `Ctrl^C`.

Congratulations for this tool and its clean code, a quick read allowed me to know where I had to type.

Cheers
L.
@DTrejo
Copy link
Owner

DTrejo commented Mar 12, 2014

Have you been able to figure out why inheriting the stdio makes letters show up really slowly in the child?

I want to use it this way (and run.js 2.0 will use it this way) I'm just sad that it messes up user typing :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants