Skip to content

Commit

Permalink
fix(cli): powershell crashing on SIGINT, closes #3997 (#4007)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Apr 29, 2022
1 parent d96805a commit 3204848
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .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.
5 changes: 3 additions & 2 deletions tooling/cli/src/dev.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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))?;
Expand Down

0 comments on commit 3204848

Please sign in to comment.