Implement abortAllActions to cancel actions

This commit is contained in:
vgcman16 2025-06-05 21:04:08 -05:00
parent b1b446f55a
commit 69f0c3f142

View File

@ -466,7 +466,31 @@ export class WorkbenchStore {
} }
abortAllActions() { abortAllActions() {
// TODO: what do we wanna do and how do we wanna recover from this? // Reset any queued actions so nothing new runs
this.#globalExecutionQueue = Promise.resolve();
// Abort currently running command in the shell if there is one
const execution = this.boltTerminal.executionState.get();
if (execution?.active) {
execution.abort?.();
// Send CTRL+C to ensure the process is interrupted
this.boltTerminal.terminal?.input('\x03');
}
// Abort all actions for every artifact
const artifacts = this.artifacts.get();
for (const artifact of Object.values(artifacts)) {
const actions = artifact.runner.actions.get();
for (const action of Object.values(actions)) {
if (action.status === 'running' || action.status === 'pending') {
action.abort();
}
}
}
} }
setReloadedMessages(messages: string[]) { setReloadedMessages(messages: string[]) {