diff --git a/crates/deno_task_shell/src/shell/types.rs b/crates/deno_task_shell/src/shell/types.rs index f78ba66..a66e442 100644 --- a/crates/deno_task_shell/src/shell/types.rs +++ b/crates/deno_task_shell/src/shell/types.rs @@ -159,6 +159,10 @@ impl ShellState { state.token = self.token.child_token(); state } + + pub fn reset_cancellation_token(&mut self) { + self.token = CancellationToken::default(); + } } #[derive(Debug, PartialEq, Eq)] diff --git a/crates/shell/src/main.rs b/crates/shell/src/main.rs index fda7872..7fc794f 100644 --- a/crates/shell/src/main.rs +++ b/crates/shell/src/main.rs @@ -66,6 +66,9 @@ async fn interactive() -> anyhow::Result<()> { let mut prev_exit_code = 0; loop { + // Reset cancellation flag + state.reset_cancellation_token(); + // Display the prompt and read a line let readline = if prev_exit_code == 0 { let cwd = state.cwd().to_string_lossy().to_string(); @@ -77,7 +80,6 @@ async fn interactive() -> anyhow::Result<()> { .strip_prefix(home_str) .map(|stripped| format!("~{}$ ", stripped.replace('\\', "/"))) .unwrap_or_else(|| format!("{}$ ", cwd)); - rl.readline(&prompt) } else { rl.readline("xxx ")