Skip to content

Commit 58a236e

Browse files
authored
fix: use stdin=inhert on vanilla run
* fix: non-utf8 stdin processing Fixes #890 Ref FormidableLabs/webpack-dashboard#16 The library blessed inside of the webpack-dashboard does some funky stuff with std streams and the expectation of the encoding. I'm not 100% sure of this change, I've got to see all the tests, but this tweak moves to inherit the child's stdin and doesn't purposely encode the stdin stream as utf8 (which, I don't recall exactly why I did this in the first place…though I'm fairly sure it was another issue somewhere else in nodemon). * fix: use stdin:inherit when we're not forked * fix: don't use inherit when required * style: lint * style: I am going to 🐎 kick the lint in the 🌰
1 parent ee110ad commit 58a236e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/monitor/run.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ function run(options) {
3737
var stdio = ['pipe', 'pipe', 'pipe'];
3838

3939
if (config.options.stdout) {
40-
stdio = ['pipe', process.stdout, process.stderr];
40+
stdio = [process.send || config.required ? 'pipe' : 'inherit',
41+
process.stdout,
42+
process.stderr,];
4143
}
4244

4345
var sh = 'sh';
@@ -227,7 +229,8 @@ function run(options) {
227229
// connect stdin to the child process (options.stdin is on by default)
228230
if (options.stdin) {
229231
process.stdin.resume();
230-
process.stdin.setEncoding('utf8');
232+
// FIXME decide whether or not we need to decide the encoding
233+
// process.stdin.setEncoding('utf8');
231234
process.stdin.pipe(child.stdin);
232235

233236
bus.once('exit', function () {

0 commit comments

Comments
 (0)