Fix for loop ctrlc not terminating (#5003)

This commit is contained in:
JT
2022-03-28 19:13:43 +13:00
committed by GitHub
parent a87f53072a
commit 2e3b74f1b2
6 changed files with 37 additions and 19 deletions

View File

@ -125,7 +125,7 @@ https://www.nushell.sh/book/thinking_in_nushell.html#parsing-and-evaluation-are-
.filter(|x| !x.is_nothing())
.into_pipeline_data(ctrlc)),
Value::Range { val, .. } => Ok(val
.into_range_iter()?
.into_range_iter(ctrlc.clone())?
.enumerate()
.map(move |(idx, x)| {
stack.with_env(&orig_env_vars, &orig_env_hidden);

View File

@ -71,7 +71,7 @@ impl Command for ParEach {
match input {
PipelineData::Value(Value::Range { val, .. }, ..) => Ok(val
.into_range_iter()?
.into_range_iter(ctrlc.clone())?
.enumerate()
.par_bridge()
.map(move |(idx, x)| {

View File

@ -81,7 +81,7 @@ pub fn calculate(
}
PipelineData::Value(Value::Range { val, .. }, ..) => {
let new_vals: Result<Vec<Value>, ShellError> = val
.into_range_iter()?
.into_range_iter(None)?
.map(|val| mf(&[val], &name))
.collect();