From 88925ec6e6dd03229d1c6413fd99335977fd2882 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Wed, 8 Jul 2026 16:00:52 -0400 Subject: [PATCH] fix(tui): allow callers without log sink --- packages/tui/src/app.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/tui/src/app.tsx b/packages/tui/src/app.tsx index 24f32e9307..c5535ad32d 100644 --- a/packages/tui/src/app.tsx +++ b/packages/tui/src/app.tsx @@ -150,7 +150,7 @@ export type TuiInput = { config: TuiConfig.Resolved onSnapshot?: () => Promise pluginHost: TuiPluginHost - log: LogSink + log?: LogSink } function errorMessage(error: unknown) { @@ -186,6 +186,7 @@ function isVersionGreater(left: string, right: string) { } export const run = Effect.fn("Tui.run")(function* (input: TuiInput) { + const log = input.log ?? (() => {}) const global = yield* Global.Service const exit = { epilogue: undefined as string | undefined, reason: undefined as unknown } const result = yield* Effect.scoped( @@ -232,7 +233,7 @@ export const run = Effect.fn("Tui.run")(function* (input: TuiInput) { try { await input.pluginHost.dispose() } catch (error) { - input.log("error", "Failed to dispose TUI plugins", { error }) + log("error", "Failed to dispose TUI plugins", { error }) } }), ) @@ -254,7 +255,7 @@ export const run = Effect.fn("Tui.run")(function* (input: TuiInput) { await render(() => { return ( - + { if (renderer.isDestroyed) return