mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-17 12:56:41 +02:00
fix(session): narrow shell cancel fallback
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user