From bf04443f3f14aaf66df54a7de70bc971f7151f50 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Fri, 7 Aug 2026 13:25:37 +0530 Subject: [PATCH] fix: resolve 4 bugs in termui --- examples/calculator/src/index.tsx | 2 +- examples/chat-app/src/index.tsx | 2 +- packages/dev-server/src/server.ts | 2 +- packages/ui/src/Form.ts | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/calculator/src/index.tsx b/examples/calculator/src/index.tsx index 852911990..a2ed8284b 100644 --- a/examples/calculator/src/index.tsx +++ b/examples/calculator/src/index.tsx @@ -403,7 +403,7 @@ class CalculatorApp extends Widget { } private evaluate() { - if (this.expression.trim() === "") return; + if (this.expression.trim().length === 0) return; const oldExpr = this.expression; this.result = safeEval(this.expression); if (this.result !== null && !this.result.startsWith("Error")) { diff --git a/examples/chat-app/src/index.tsx b/examples/chat-app/src/index.tsx index a3a2ddb14..0d405714e 100644 --- a/examples/chat-app/src/index.tsx +++ b/examples/chat-app/src/index.tsx @@ -257,7 +257,7 @@ function parseBlocks(text: string): Block[] { } // ── Handle Paragraphs ──────────────────────── - if (line.trim() === '') { + if (line.trim().length === 0) { blocks.push({ type: 'paragraph', text: '', diff --git a/packages/dev-server/src/server.ts b/packages/dev-server/src/server.ts index 47d4f2b6d..b31a4da89 100644 --- a/packages/dev-server/src/server.ts +++ b/packages/dev-server/src/server.ts @@ -380,7 +380,7 @@ export class DevServer { this._killChild(); - await exitedPromise.catch(() => {}); + await exitedPromise.catch( => console.error()); if (this._running && this._entryFile) { this._spawnChild(); diff --git a/packages/ui/src/Form.ts b/packages/ui/src/Form.ts index bf96ede6b..38d630037 100644 --- a/packages/ui/src/Form.ts +++ b/packages/ui/src/Form.ts @@ -138,3 +138,5 @@ export class Form extends Widget { } } } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file