fix(session): narrow shell cancel fallback

This commit is contained in:
Kit Langton 2026-04-27 16:33:06 -04:00
commit 8df9f54c1d
2 changed files with 6 additions and 4 deletions

View file

@ -159,7 +159,10 @@ export const make = <A, E = never>(
Effect.gen(function* () {
const exit = yield* Fiber.await(fiber)
if (Exit.isSuccess(exit)) return exit.value
if (Cause.hasInterruptsOnly(exit.cause) || ((yield* Deferred.isDone(cancelled)) && !Cause.hasDies(exit.cause))) {
if (
Cause.hasInterruptsOnly(exit.cause) ||
((yield* Deferred.isDone(cancelled)) && Cause.hasInterrupts(exit.cause) && !Cause.hasDies(exit.cause))
) {
if (onInterrupt) return yield* onInterrupt
return yield* Effect.die(new Cancelled())
}

View file

@ -787,9 +787,8 @@ NOTE: At any point in time through this workflow you should feel free to ask the
},
}
yield* sessions.updatePart(part)
yield* markReady
return { msg, part, cwd: ctx.directory }
}).pipe(Effect.onExit(() => markReady))
}).pipe(Effect.ensuring(markReady))
const cfg = yield* config.get()
const sh = Shell.preferred(cfg.shell)
@ -848,7 +847,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
}).pipe(Effect.scoped, Effect.orDie),
).pipe(Effect.exit)
if (Exit.isFailure(exit) && Cause.hasInterrupts(exit.cause)) {
if (Exit.isFailure(exit) && Cause.hasInterrupts(exit.cause) && !Cause.hasDies(exit.cause)) {
aborted = true
}
yield* finish