From 320484866b83ecabb01eb58d158e0fedd9dd08be Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Fri, 29 Apr 2022 15:51:08 -0700 Subject: [PATCH] fix(cli): powershell crashing on SIGINT, closes #3997 (#4007) --- .changes/fix-cli-powershell.md | 6 ++++++ tooling/cli/src/dev.rs | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changes/fix-cli-powershell.md diff --git a/.changes/fix-cli-powershell.md b/.changes/fix-cli-powershell.md new file mode 100644 index 000000000..a1afe2d7f --- /dev/null +++ b/.changes/fix-cli-powershell.md @@ -0,0 +1,6 @@ +--- +"cli.rs": patch +"cli.js": patch +--- + +Fixes a Powershell crash when sending SIGINT to the dev command. diff --git a/tooling/cli/src/dev.rs b/tooling/cli/src/dev.rs index 82d409b32..2930ef5b4 100644 --- a/tooling/cli/src/dev.rs +++ b/tooling/cli/src/dev.rs @@ -25,7 +25,7 @@ use std::{ fs::FileType, io::{BufReader, Write}, path::{Path, PathBuf}, - process::{exit, Command}, + process::{exit, Command, Stdio}, sync::{ atomic::{AtomicBool, Ordering}, mpsc::channel, @@ -126,6 +126,7 @@ fn command_internal(options: Options) -> Result<()> { .pipe()?; // development build always includes debug information command }; + command.stdin(Stdio::piped()); let child = SharedChild::spawn(&mut command) .unwrap_or_else(|_| panic!("failed to run `{}`", before_dev)); @@ -489,7 +490,7 @@ fn start_app( } command.stdout(os_pipe::dup_stdout().unwrap()); - command.stderr(std::process::Stdio::piped()); + command.stderr(Stdio::piped()); let child = SharedChild::spawn(&mut command).with_context(|| format!("failed to run {}", runner))?;