Skip to content

Commit c526bef

Browse files
committed
Silence external program output of background jobs
This makes so that the stdout and stderr output of background jobs is ignored, but still allows background jobs to use `print` in case users actually want job's outputs. We should probably also consider the aproach taken with nushell/reedline#737 and nushell#11696.
1 parent b603eaf commit c526bef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/nu-command/src/system/run_external.rs

+4
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ impl Command for External {
206206
);
207207
command.stderr(writer);
208208
Some(reader)
209+
} else if engine_state.is_background_job() {
210+
command.stdout(Stdio::null());
211+
command.stderr(Stdio::null());
212+
None
209213
} else {
210214
command.stdout(
211215
Stdio::try_from(stdout).map_err(|err| IoError::new(err.kind(), call.head, None))?,

0 commit comments

Comments
 (0)