nushell/crates/nu-command/src/system
Ian Manske 924986576d
Do not block signals for child processes (#11402)
# Description / User-Facing Changes
Signals are no longer blocked for child processes launched from both
interactive and non-interactive mode. The only exception is that
`SIGTSTP`, `SIGTTIN`, and `SIGTTOU` remain blocked for child processes
launched only from **interactive** mode. This is to help prevent nushell
from getting into an unrecoverable state, since we don't support
background jobs. Anyways, this fully fixes #9026.

# Other Notes
- Needs Rust version `>= 1.66` for a fix in
`std::process::Command::spawn`, but it looks our current Rust version is
way above this.
- Uses `sigaction` instead of `signal`, since the behavior of `signal`
can apparently differ across systems. Also, the `sigaction` man page
says:
> The sigaction() function supersedes the signal() function, and should
be used in preference.

Additionally, using both `sigaction` and `signal` is not recommended.
Since we were already using `sigaction` in some places (and possibly
some of our dependencies as well), this PR replaces all usages of
`signal`.

# Tests
Might want to wait for #11178 for testing.
2024-01-15 16:08:21 -06:00
..
complete.rs Bubble up errors passed to complete (#11313) 2023-12-16 09:07:08 -06:00
exec.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
mod.rs Add exec command for Windows (#11001) 2023-11-08 14:50:25 -06:00
nu_check.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
ps.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
registry_query.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
run_external.rs Do not block signals for child processes (#11402) 2024-01-15 16:08:21 -06:00
sys.rs Bump sysinfo from 0.29 to 0.30 (#11484) 2024-01-05 05:31:29 -06:00
which_.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00