diff --git a/cli/src/index.tsx b/cli/src/index.tsx index c6e6084a3..fe3a7bef0 100644 --- a/cli/src/index.tsx +++ b/cli/src/index.tsx @@ -300,11 +300,28 @@ async function main(): Promise { backgroundColor: 'transparent', exitOnCtrlC: false, }) - createRoot(renderer).render( + + const root = createRoot(renderer) + + // React component tree to render + const app = ( - , + ) + + // Add resize event listener for terminal resize support on Windows PowerShell + // On Windows, the SIGWINCH signal may not fire reliably, so we listen to + // process.stdout 'resize' event to ensure the UI updates when the window is resized + if (process.stdout.isTTY) { + process.stdout.on('resize', () => { + // Re-render the React tree to update with new terminal dimensions + root.render(app) + }) + } + + // Initial render + root.render(app) } void main()