Skip to content

Commit f48d10d

Browse files
CopilotPierrunoYT
andcommitted
Add SIGWINCH listener for terminal resize on Windows PowerShell
Co-authored-by: PierrunoYT <95778421+PierrunoYT@users.noreply.github.com>
1 parent d92d5de commit f48d10d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

cli/src/index.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,25 @@ async function main(): Promise<void> {
300300
backgroundColor: 'transparent',
301301
exitOnCtrlC: false,
302302
})
303-
createRoot(renderer).render(
303+
304+
const root = createRoot(renderer)
305+
306+
// Add SIGWINCH listener for terminal resize support on Windows PowerShell
307+
// This ensures the terminal UI updates when the window is resized
308+
// The listener triggers a re-render to update the layout with new dimensions
309+
if (process.stdout.isTTY) {
310+
process.stdout.on('resize', () => {
311+
// Re-render the React tree to update with new terminal dimensions
312+
// This is necessary on Windows where SIGWINCH may not work reliably
313+
root.render(
314+
<QueryClientProvider client={queryClient}>
315+
<AppWithAsyncAuth />
316+
</QueryClientProvider>,
317+
)
318+
})
319+
}
320+
321+
root.render(
304322
<QueryClientProvider client={queryClient}>
305323
<AppWithAsyncAuth />
306324
</QueryClientProvider>,

0 commit comments

Comments
 (0)