fix(session): narrow shell cancel fallback
This commit is contained in:
parent
042748a1b1
commit
8df9f54c1d
2 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue