You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TUI crashes (Bun segfault) when the terminal shrinks to extreme sizes (~2×1) #38199
What happened
Dragging the pane hosting opencode 1.18.4 down to an extreme size (approaching 2 cols × 1 row,
rapid SIGWINCH/TIOCSWINSZ stream) crashes the process — "Bun has crashed / Segmentation fault",
exit 1. Two independent hits, same stack family (JSC microtask drain, generator microtasks):
Environment: macOS aarch64, host = xterm.js in a Tauri app over a PTY (portable-pty).
A session was open (conversation view rendered). Filed the VM side as oven-sh/bun#35010 as well —
a Bun VM shouldn't segfault on whatever the TUI does — but opentui likely also wants a
defensive minimum-size clamp in its layout so pathological grids can't drive that path.
Repro honesty: reliable in our real app at extreme shrink; ~10 headless PTY variants
(staircase drags, floor jitter at 1–4 cols, query replies, mouse-motion floods) did NOT
reproduce, so exact timing/state in the terminal byte stream matters.
Workaround that works: floor the grid the host reports to the PTY (we use 20×5 and clip
visually below that) — real terminals never offer a TUI 2×1 either.
Activity
github-actions commentedon Sep 20, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.