fix(pty): reset persistent shell on cancellation

This commit is contained in:
Tianyi Cui
2026-07-29 21:33:39 +08:00
parent fbad903dd0
commit 205702adaf
2 files changed
+31 -22

No files matched your search

@@ -309,6 +309,10 @@ async function executeCommand(
SHELL_RESET_MESSAGE,
].join('\n')
}
if (commandDeadline.signal.aborted) {
await shells.reset(owner, 'persistent bash command aborted')
commandDeadline.signal.throwIfAborted()
}
if (latest.text.includes(marker.end)) {
const complete = commandOutput(retainedScrollback(ctx, owner, id, latest), marker)
return renderCaptured(complete, config.maxOutputChars)
@@ -325,10 +329,6 @@ async function executeCommand(
SHELL_RESET_MESSAGE,
].filter(part => part.length > 0).join('\n')
}
if (commandDeadline.signal.aborted) {
await shells.reset(owner, 'persistent bash command aborted')
commandDeadline.signal.throwIfAborted()
}
if (promptCompleted(result)) {
const snapshot = retainedScrollback(ctx, owner, id, latest)
return renderCaptured(