Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Don't allow child scripts to manipulate terminal #227

Merged
merged 5 commits into from
Jul 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/commands/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,14 @@ function startDevServer(settings, log) {
const args =
settings.command === "npm" ? ["run", ...settings.args] : settings.args;
const ps = execa(settings.command, args, {
env: settings.env,
stdio: "inherit"
env: { ...settings.env, FORCE_COLOR: "true" },
stdio: ["inherit", "pipe", "pipe"]
});
ps.stdout.on("data", function(buffer) {
process.stdout.write(buffer.toString("utf8"));
});
ps.stderr.on("data", function(buffer) {
process.stderr.write(buffer.toString("utf8"));
});
ps.on("close", code => process.exit(code));
ps.on("SIGINT", process.exit);
Expand Down Expand Up @@ -318,7 +324,8 @@ DevCommand.flags = {
}),
port: flags.integer({
char: "p",
description: "port of netlify dev" }),
description: "port of netlify dev"
}),
dir: flags.string({
char: "d",
description: "dir with static files"
Expand Down