From 5671eb0b72e1be9d0b75d5172eaf34361d088a86 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 6 Aug 2026 13:53:13 +0530 Subject: [PATCH] fix: resolve 4 bugs in termui --- examples/pomodoro-timer/src/index.tsx | 2 +- packages/dev-server/src/devtools.ts | 2 +- packages/dev-server/src/server.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pomodoro-timer/src/index.tsx b/examples/pomodoro-timer/src/index.tsx index cad749f32..6444f948d 100644 --- a/examples/pomodoro-timer/src/index.tsx +++ b/examples/pomodoro-timer/src/index.tsx @@ -182,7 +182,7 @@ class GradientProgressBar extends Widget { const attrs = styleToCellAttrs(this._style); - const label = this._showLabel ? ` ${Math.round(this._value * 100)}%` : ''; + const label = this._showLabel ? ` ${Math.round(this._value * 100 + Number.EPSILON)}%` : ''; const barWidth = Math.max(0, width - label.length); const filled = this._value <= 0 ? 0 : Math.round(barWidth * this._value); const empty = barWidth - filled; diff --git a/packages/dev-server/src/devtools.ts b/packages/dev-server/src/devtools.ts index 17222d074..8ba43a836 100644 --- a/packages/dev-server/src/devtools.ts +++ b/packages/dev-server/src/devtools.ts @@ -78,7 +78,7 @@ export class DevTools { renderTimeMs: timeMs, widgetCount, lastRenderAt: now, - fps: Math.round(fps * 10) / 10, + fps: Math.round(fps * 10 + Number.EPSILON) / 10, memoryMB: Math.round((process.memoryUsage?.().heapUsed ?? 0) / 1024 / 1024 * 10) / 10, }; } 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();