From 8c666666ef076cf45fdfb6b71dc1fa06767761e1 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 20 Jan 2026 16:02:47 +0000 Subject: [PATCH] fix(tui): update CustomEditor ctor --- src/tui/components/custom-editor.ts | 7 +++---- src/tui/tui.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tui/components/custom-editor.ts b/src/tui/components/custom-editor.ts index e1a4a8d1c..ad631f0e6 100644 --- a/src/tui/components/custom-editor.ts +++ b/src/tui/components/custom-editor.ts @@ -13,10 +13,9 @@ export class CustomEditor extends Editor { onAltEnter?: () => void; constructor(tuiOrTheme: TUI | EditorTheme, themeMaybe?: EditorTheme) { - const useTui = typeof themeMaybe !== "undefined" && Editor.length >= 2; - const args = (useTui ? [tuiOrTheme, themeMaybe] : [tuiOrTheme]) as ConstructorParameters< - typeof Editor - >; + const useLegacyCtor = typeof themeMaybe !== "undefined" && Editor.length >= 2; + const args = (useLegacyCtor ? [tuiOrTheme, themeMaybe] : [themeMaybe ?? tuiOrTheme]) as + ConstructorParameters; super(...args); } handleInput(data: string): void { diff --git a/src/tui/tui.ts b/src/tui/tui.ts index a5e6e34d7..753f5511f 100644 --- a/src/tui/tui.ts +++ b/src/tui/tui.ts @@ -193,7 +193,7 @@ export async function runTui(opts: TuiOptions) { const statusContainer = new Container(); const footer = new Text("", 1, 0); const chatLog = new ChatLog(); - const editor = new CustomEditor(tui, editorTheme); + const editor = new CustomEditor(editorTheme); const root = new Container(); root.addChild(header); root.addChild(chatLog);