diff --git a/crates/nu-command/src/platform/sleep.rs b/crates/nu-command/src/platform/sleep.rs index a3e352a565..37e23d1caa 100644 --- a/crates/nu-command/src/platform/sleep.rs +++ b/crates/nu-command/src/platform/sleep.rs @@ -56,7 +56,7 @@ impl Command for Sleep { let ctrlc_ref = &engine_state.ctrlc.clone(); let start = Instant::now(); loop { - thread::sleep(CTRL_C_CHECK_INTERVAL); + thread::sleep(CTRL_C_CHECK_INTERVAL.min(total_dur)); if start.elapsed() >= total_dur { break; }