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 hangs in tmux after opentui 0.1.103 upgrade (theme detection) #24475
After the opentui upgrade from 0.1.99 to 0.1.103 in commit 3a5507d, the TUI becomes unresponsive when running inside tmux. Every keystroke lags significantly, making the app unusable.
Root Cause
0.1.103 introduced renderer.waitForThemeMode(timeout) which sends OSC escape sequences to detect the terminal's background color. tmux doesn't forward these properly, so the call blocks for the full timeout duration on each render cycle — not just once at startup.
The call site is in packages/opencode/src/cli/cmd/tui/app.tsx:133:
This issue might be a duplicate of or closely related to existing issues. Please check:
bug: typecheck fails on dev — waitForThemeMode does not exist on CliRenderer #23504: Directly references the same waitForThemeMode call at the same code location (app.tsx:132) — that issue reports a typecheck failure because waitForThemeMode doesn't exist on CliRenderer in the pinned opentui version; your issue describes the runtime consequence of using it in a newer opentui version where it blocks in tmux.
If your issue is distinct from the above, feel free to keep it open. Otherwise, consider referencing or closing in favour of the most relevant existing issue.
Can confirm a very similar issue on the current release.
Environment:
opencode 1.14.25
tmux 3.6a
macOS
Ghostty
When I run opencode inside tmux, the TUI hangs / becomes very sluggish in a way that feels consistent with the theme-detection issue described here. I’m seeing this on the released build (1.14.25), not just on dev.
@thdxr workaround for me was set -g allow-passthrough off on tmux config.
Opencode seems to probes Kitty graphics via DCS-wrapped APC and stalls on the response path.
Down below was my debugging session with claude
TUI hangs / input lag inside tmux when allow-passthrough on
Summary
The opencode TUI freezes on startup when launched inside a tmux pane that has set -g allow-passthrough on. The cursor blinks rapidly in the top-left corner, the prompt input box never accepts keystrokes,
and the UI never finishes painting. Outside tmux (Ghostty directly) it works perfectly.
This appears to be the same root cause as upstream issue #24475 — the renderer.waitForThemeMode(1000) call introduced in opentui 0.1.103 (commit 3a5507d) sends OSC background-color probes that don't round-trip cleanly through tmux, blocking each render cycle for the full 1s timeout.
Environment
Field
Value
opencode version
1.14.25 (Mach-O arm64, Bun-compiled)
Outer terminal
Ghostty (with Ghostty's bundled terminfo on TERMINFO)
tmux
3.6a
Shell
nu (also reproduces from bash -c 'opencode --pure')
Reduced ~/.config/tmux/tmux.conf to three minimal variants (no TPM, no powerline). Each launched via tmux -f <file> new-session after tmux kill-server:
DCS tmux; ESC ESC_Gi=31337,s=1,v=1,a=q,t=d,f=24;AAAA ESC ESC \\ ESC ESC[c ESC \ — Kitty graphics capability probe wrapped in tmux passthrough, followed by DA1
ESC]4;0;? BEL … ESC]4;37;? BEL — palette queries for indices 0–37
The Kitty graphics probe is the one that requires allow-passthrough on to reach Ghostty. With passthrough on, the response path stalls (matching #24475's description that waitForThemeMode blocks
per-render). With passthrough off, tmux drops the wrapped DCS silently and opencode falls back to a default theme — TUI starts immediately.
Workaround
Disable Kitty-graphics passthrough in tmux:
# ~/.config/tmux/tmux.conf# set -g allow-passthrough on # opencode hangs in tmux until upstream opentui fix
Then tmux kill-server and reattach.
Trade-off: image-preview tools (yazi, timg, kitten icat) lose Kitty graphics inside tmux. Re-enable temporarily per-session with tmux set -g allow-passthrough on after opencode has started, if needed.
Suggested fix (upstream)
Per #24475: either remove the per-render waitForThemeMode call, cache the result after the first probe, or use a much shorter timeout (e.g. 50–100 ms) when the terminal is detected as tmux ($TMUX set, or XTVERSION reply contains tmux). Hardcoding "dark" as a fallback is acceptable for tmux sessions.
Activity
github-actions commentedon Apr 26, 2026
This issue might be a duplicate of or closely related to existing issues. Please check:
waitForThemeModecall at the same code location (app.tsx:132) — that issue reports a typecheck failure becausewaitForThemeModedoesn't exist onCliRendererin the pinned opentui version; your issue describes the runtime consequence of using it in a newer opentui version where it blocks in tmux.If your issue is distinct from the above, feel free to keep it open. Otherwise, consider referencing or closing in favour of the most relevant existing issue.
crierr commentedon Apr 26, 2026
Can confirm a very similar issue on the current release.
Environment:
When I run
opencodeinside tmux, the TUI hangs / becomes very sluggish in a way that feels consistent with the theme-detection issue described here. I’m seeing this on the released build (1.14.25), not just ondev.wallchristopher commentedon Apr 26, 2026
Also have this issue but only within vscode's integrated terminal. Running on external Alacritty work fine.
The above work around solved my issue.
thdxr commentedon Apr 26, 2026
i am a tmux user and i haven't seen this. is it possible to share tmux config to see if we can reproduce?
unifin-chief-engineer commentedon Apr 26, 2026
Same problem in tmux. opencode works in ghostty but when you run in tmux it starts strobbing.
kommander commentedon Apr 26, 2026
Better in 1.14.26?
crierr commentedon Apr 27, 2026
It’s not reproducible for me in 1.14.26. Thanks!
MomePP commentedon Apr 27, 2026
v1.14.26 fixed for me as well
@thdxr workaround for me was
set -g allow-passthrough offon tmux config.Opencode seems to probes Kitty graphics via DCS-wrapped APC and stalls on the response path.
Down below was my debugging session with claude
wallchristopher commentedon Apr 27, 2026
My issue is fixed within opencode 1.14.28. I also had
set -g allow-passthrough onThank you
github-actions commentedon Aug 18, 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.