reset signals in catch block

This commit is contained in:
WindSoilder 2024-07-17 21:12:26 +08:00
parent b66671d339
commit 96d21d9ab0
2 changed files with 2 additions and 1 deletions

View File

@ -116,6 +116,7 @@ fn handle_catch(
stack: &mut Stack,
eval_block_fn: EvalBlockFn,
) -> Result<PipelineData, ShellError> {
engine_state.reset_signals();
if let Some(catch_block) = catch_block {
let catch_block = engine_state.get_block(catch_block.block_id);
// Put the error value in the positional closure var

View File

@ -182,7 +182,7 @@ impl EngineState {
&self.signals
}
pub fn reset_signals(&mut self) {
pub fn reset_signals(&self) {
self.signals.reset()
}