Try again: in unix like system, set foreground process while running external command (#6273)

* Revert "Fix intermittent test crash (#6268)"

This reverts commit 555d9ee763.

* make a working version again

* try second impl

* add

* fmt

* check stdin is atty before acquire stdin

* add libc

* clean comment

* fix typo
This commit is contained in:
WindSoilder
2022-08-18 18:41:01 +08:00
committed by GitHub
parent df3b6d9d26
commit 1d18f6947e
7 changed files with 192 additions and 11 deletions

View File

@ -134,6 +134,14 @@ fn main() -> Result<()> {
let parsed_nu_cli_args = parse_commandline_args(&nushell_commandline_args, &mut engine_state);
#[cfg(target_family = "unix")]
{
// This will block SIGTSTP, SIGTTOU, SIGTTIN, and SIGCHLD, which is required
// for this shell to manage its own process group / children / etc.
nu_system::signal::block();
nu_system::signal::set_terminal_leader()
}
match parsed_nu_cli_args {
Ok(binary_args) => {
if let Some(t) = binary_args.threads {