Fixed ctrl-c in recursion loop bug #5362 (#5409)

This commit is contained in:
Yuheng Su 2022-05-02 16:18:25 +08:00 committed by GitHub
parent 49cbc30974
commit 7c9a78d922
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,11 @@ pub fn eval_call(
call: &Call,
input: PipelineData,
) -> Result<PipelineData, ShellError> {
if let Some(ctrlc) = &engine_state.ctrlc {
if ctrlc.load(core::sync::atomic::Ordering::SeqCst) {
return Ok(Value::Nothing { span: call.head }.into_pipeline_data());
}
}
let decl = engine_state.get_decl(call.decl_id);
if !decl.is_known_external() && call.named_iter().any(|(flag, _, _)| flag.item == "help") {