From d92d5de6cd5f9bd045a59cd97a5da9ca29535e84 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Dec 2025 11:46:15 +0000 Subject: [PATCH 1/3] Initial plan From f48d10d452cc113621c8a30834f4ee94508765f8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Dec 2025 11:53:16 +0000 Subject: [PATCH 2/3] Add SIGWINCH listener for terminal resize on Windows PowerShell Co-authored-by: PierrunoYT <95778421+PierrunoYT@users.noreply.github.com> --- cli/src/index.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/cli/src/index.tsx b/cli/src/index.tsx index c6e6084a3..bcea62a30 100644 --- a/cli/src/index.tsx +++ b/cli/src/index.tsx @@ -300,7 +300,25 @@ async function main(): Promise { backgroundColor: 'transparent', exitOnCtrlC: false, }) - createRoot(renderer).render( + + const root = createRoot(renderer) + + // Add SIGWINCH listener for terminal resize support on Windows PowerShell + // This ensures the terminal UI updates when the window is resized + // The listener triggers a re-render to update the layout with new dimensions + if (process.stdout.isTTY) { + process.stdout.on('resize', () => { + // Re-render the React tree to update with new terminal dimensions + // This is necessary on Windows where SIGWINCH may not work reliably + root.render( + + + , + ) + }) + } + + root.render( , From 0f3590734cf98a8e454dcf9ae176a9b286d5c7f7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Dec 2025 11:55:34 +0000 Subject: [PATCH 3/3] Address code review feedback: extract JSX and clarify comments Co-authored-by: PierrunoYT <95778421+PierrunoYT@users.noreply.github.com> --- cli/src/index.tsx | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/cli/src/index.tsx b/cli/src/index.tsx index bcea62a30..fe3a7bef0 100644 --- a/cli/src/index.tsx +++ b/cli/src/index.tsx @@ -303,26 +303,25 @@ async function main(): Promise { const root = createRoot(renderer) - // Add SIGWINCH listener for terminal resize support on Windows PowerShell - // This ensures the terminal UI updates when the window is resized - // The listener triggers a re-render to update the layout with new dimensions + // 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 - // This is necessary on Windows where SIGWINCH may not work reliably - root.render( - - - , - ) + root.render(app) }) } - root.render( - - - , - ) + // Initial render + root.render(app) } void main()