tui: allow forcing synchronized output (DECSET 2026) inside tmux
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 65/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- cli
Direzione di ricerca
Inizia leggendo la configurazione del renderer TUI e la risoluzione della modalità di sessione del terminale descritte nell’issue, quindi segui il modo in cui le opzioni del renderer vengono esposte agli utenti. Il lavoro è completato quando gli utenti possono selezionare auto, always o never e la modalità selezionata controlla i marker di output sincronizzato all’interno di tmux; l’issue fornisce un comando di acquisizione per verificare i marker.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When opencode runs inside tmux, the TUI never wraps frames in synchronized
output (CSI ? 2026 h/l), so tmux redraws partial frames and animations (e.g.
the tab indicator) visibly stutter. The renderer already supports a
synchronizedOutput mode (auto / always / never), but opencode does not
expose it, and auto deliberately disables it whenever a multiplexer is
detected. Please make this configurable so users on tmux ≥ 3.7 can opt in.
Environment
- opencode version: 2.2.3 (latest)
- OS: Linux 7.0.0-38-generic (Ubuntu 26.04, x86_64)
- Terminal: Windows Terminal over SSH → tmux 3.8;
TERM=tmux-256color,TERM_PROGRAM=tmux,COLORTERM=truecolor - Shell: /bin/bash
- Install/channel: latest (standalone binary,
~/.opencode/bin/opencode) - Active plugins: none found in config
Reproduction
- Run the TUI inside tmux 3.7+ (
tmux new-session -A -s oc opencode). - Record the pane output:
tmux pipe-pane -t <pane> -o 'cat > /tmp/pane.bin'. - Trigger an animated area (the working indicator / tab animation) and keep it running for ~10 s.
- Count synchronized-output markers in the capture:
python3 -c "d=open('/tmp/pane.bin','rb').read(); print(d.count(b'\x1b[?2026h'))"
Expected Behavior
With a terminal that advertises synchronized output support, the TUI batches
each frame in CSI ? 2026 h … CSI ? 2026 l, so the multiplexer draws complete
frames and animations are smooth. Ideally this can be controlled from config,
e.g. sync/synchronized_output with auto (default), always, never.
Actual Behavior
Inside tmux the count is 0 synchronized frames, while the same TUI outside
tmux emits frames in pairs. 10-second captures on the same machine:
| Run | Capture size | ?2026h / ?2026l |
|---|---|---|
| inside tmux 3.8 | 71,051 B | 0 / 0 |
inside tmux, TMUX unset |
70,986 B | 127 / 127 |
inside tmux, TMUX unset (10 s) |
243,015 B | 250 / 250 |
The rendering still happens (dozens of KB per second, thousands of cursor
positioning sequences), it is simply not batched, which shows up as uneven
animation pacing.
The tmux side is capable: tmux 3.8 answers DECRQM 2026 with ?2026;2$y and
tracks DECSET 2026 from applications (it responds ?2026;1$y while a
synchronized update is open).
Additional Context
The gating is in the renderer setup, not in tmux: the TUI process passes
hostMultiplexer: ... && !!(process.env.TMUX || process.env.STY || process.env.ZELLIJ)
into the terminal session, and the session resolves the mode as
s.synchronizedOutput ?? "auto". The native flags already exist
(OT_TERMINAL_SYNC_ALWAYS, OT_TERMINAL_SYNC_NEVER, OT_TERMINAL_HOST_MULTIPLEXER),
and the terminal setup accepts "auto" | "always" | "never" — but the TUI
renderer options never set synchronizedOutput, so auto always wins and a
multiplexer disables batching.
Why "auto" for multiplexers made sense historically: tmux older than 3.7 ignores
?2026h/l, so batching had no effect. Since 3.7 tmux responds to DECRQM 2026
and supports DECSET 2026 from applications, and 3.8 additionally fixed redraw
issues around synchronized updates (flicker with alternate-screen applications,
scrollbars, tabs, status lines).
Workaround currently in use: launch the TUI with TMUX removed from its
environment (env -u TMUX -u TMUX_PANE opencode). That flips hostMultiplexer
off, batching starts (250 frames / 10 s), and animations become smooth — but it
also disables all intentional multiplexer-aware behaviour, which is why a
first-class option would be preferable.
Relevant versions: opencode 2.2.3, tmux 3.8 (statically built), Ubuntu 26.04.
- Lingua principale
- TypeScript
- Stelle
- 221k
- Fork
- 29.6k
- Merge medio
- 7h 19m
- PR unite (30g)
- 504
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di anomalyco/opencode
-
core: OpenRouter BYOK sessions record cost = 0 since v2.2.0 (ignores cost_details.upstream_inference_cost)Forse già presa @tneemo l’ha presa 1 giorno fa. Apertareproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
anomalyco/opencode#60558 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
anomalyco/opencode#60541 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
anomalyco/opencode#60529 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anomalyco/opencode#60469 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
TUI permission prompt for MCP tools doesn't show the call argumentsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
anomalyco/opencode#60350 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di anomalyco/opencode
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Northeastern-Electric-Racing/FinishLine#4660 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
excaliburjs/Excalibur#3895 ·
I maintainer di solito rispondono entro 3 giorni
-
infer_audio_type only recognises one MPEG Layer III frame header, so most MP3 files are rejectedForse già presa @Steve-20-ai l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Earn report crashes with "RangeError: Invalid time value" when a report row has an unparsable timestampForse già presa @Gurkaran18 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
joinmarket-webui/jam#1588 ·
I maintainer di solito rispondono entro 3 giorni
-
BeOS .json missingAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mihaip/infinite-mac#475 ·