fix(tmux): start panes at 220x50 to avoid kiro-cli SIGWINCH input dea…#218
Merged
Conversation
…th (#216) kiro-cli 2.1.x's TUI v2 fails to repaint after a SIGWINCH from the attach-time tmux resize. CAO created detached sessions at tmux's default 80x24, and `cao launch` immediately attached the user's terminal — triggering an 80x24 → real-terminal-size resize that kiro handled by blanking the screen and silently dropping all subsequent input. Every `send_message` after attach timed out in IDLE. Creating the pane at 220x50 up front makes the attach-time resize a no-op or small shrink, which kiro repaints correctly. All other providers already tolerate wide panes, so the change is scoped to closing the kiro repaint bug. Reproduced 10/10 on kiro-cli 2.1.1 before the fix; passes reliably after. Upstream bug should be filed at kirodotdev/Kiro, but we can't block on that. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
|
@carlosiduarte can you please help to review? many thanks. |
carlosiduarte
approved these changes
Apr 29, 2026
carlosiduarte
left a comment
There was a problem hiding this comment.
Thanks @haofeif! I can confirm this fix works — I've been running x=220, y=50 locally as a patch since I hit this exact issue (#216) and it's been solid across Warp and Terminal.app.
The reasoning is spot-on: making the attach-time resize a shrink instead of a grow is the right workaround given that kiro-cli 2.1.x's SIGWINCH handler only breaks on grows. The unit test guarding the dimensions is a nice touch too.
Appreciate you picking this up and getting it into upstream properly!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #216. kiro-cli 2.1.x's TUI v2 fails to repaint after a
SIGWINCHfrom tmux's attach-time resize. CAO created detached sessions at tmux's default 80×24, andcao launchimmediately attached the user's terminal — triggering an 80×24 → real-terminal-size resize that kiro handled by blanking the screen and silently dropping all subsequent input.Reproduction (on latest main, kiro-cli 2.1.1, tmux 3.5a)
10/10 runs fail with the following flow:
tmux resize-window -x 220 -y 50(equivalent totmux attach-sessionresizing to user's terminal)tmux send-keys "hello"lands in the buffer but nothing appears on-screenPOST /input— status staysidlefor 30+ s, never transitions toprocessing/completedFix
Add explicit
x=220, y=50toTmuxClient.create_session()'snew_session(...)call so the pane is born at a realistic size. The attach-time resize is then a no-op or small shrink (e.g. 220×50 → 200×48), which kiro handles correctly.Why 220×50: wider than nearly any real terminal, so the attach is always a shrink rather than a grow. Shrinks redraw cleanly; grows are what kiro 2.1.x breaks on.
Changes
src/cli_agent_orchestrator/clients/tmux.pycreate_session(): passx=220, y=50toserver.new_session(...), with an inline comment linking to kiro_cli: TUI v2 input unresponsive when session created headless (80x24 default pane size) #216 explaining why the parameters are load-bearing.test/clients/test_tmux_client.pytest_create_session_uses_explicit_dimensions: assertsx=220, y=50land on thenew_sessioncall. Guards against accidental removal during future cleanup.Why scoped to
create_sessiononlyAll CAO providers share this session-creation path. None of the other providers tested (claude_code, codex, gemini_cli, copilot_cli, kimi_cli, opencode_cli, q_cli) show any input sensitivity to pane size — only kiro-cli's new TUI has the repaint bug. But since every provider benefits from consistent starting dimensions (no surprise resize on attach), a global change is simpler and safer than a provider-specific override.
Verification
black --check src/ test/cleanisort --check-only src/ test/cleansend_messagecompletes in ~5 s with correct output.Upstream
The root cause is a kiro-cli 2.1.x bug in its
SIGWINCHhandler — tmux and all other TUI providers handle grow-resizes correctly. Worth filing at kirodotdev/Kiro with the exact repro above, but we can't block on that fix landing.Test plan
cao launch --agents developer --auto-approve(non-headless) accepts keyboard input on the user's terminal after attach