mirror of
https://github.com/nushell/nushell.git
synced 2025-05-01 08:34:26 +02:00
Don't collect job output (#15365)
# Description Fixes #15359. # User-Facing Changes Bug fix.
This commit is contained in:
parent
2c1d261cca
commit
968eb45fb2
@ -8,8 +8,8 @@ use std::{
|
|||||||
|
|
||||||
use nu_engine::{command_prelude::*, ClosureEvalOnce};
|
use nu_engine::{command_prelude::*, ClosureEvalOnce};
|
||||||
use nu_protocol::{
|
use nu_protocol::{
|
||||||
engine::{Closure, Job, ThreadJob},
|
engine::{Closure, Job, Redirection, ThreadJob},
|
||||||
report_shell_error, Signals,
|
report_shell_error, OutDest, Signals,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@ -76,15 +76,18 @@ impl Command for JobSpawn {
|
|||||||
let result = thread::Builder::new()
|
let result = thread::Builder::new()
|
||||||
.name(format!("background job {}", id.get()))
|
.name(format!("background job {}", id.get()))
|
||||||
.spawn(move || {
|
.spawn(move || {
|
||||||
ClosureEvalOnce::new(&job_state, &job_stack, closure)
|
let mut stack = job_stack.reset_pipes();
|
||||||
|
let stack = stack.push_redirection(
|
||||||
|
Some(Redirection::Pipe(OutDest::Null)),
|
||||||
|
Some(Redirection::Pipe(OutDest::Null)),
|
||||||
|
);
|
||||||
|
ClosureEvalOnce::new_preserve_out_dest(&job_state, &stack, closure)
|
||||||
.run_with_input(Value::nothing(head).into_pipeline_data())
|
.run_with_input(Value::nothing(head).into_pipeline_data())
|
||||||
.and_then(|data| data.into_value(head))
|
.and_then(|data| data.drain())
|
||||||
.unwrap_or_else(|err| {
|
.unwrap_or_else(|err| {
|
||||||
if !job_state.signals().interrupted() {
|
if !job_state.signals().interrupted() {
|
||||||
report_shell_error(&job_state, &err);
|
report_shell_error(&job_state, &err);
|
||||||
}
|
}
|
||||||
|
|
||||||
Value::nothing(head)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user