Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

tui: allow forcing synchronized output (DECSET 2026) inside tmux

Aperta Adatta ai principianti
#60,584 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

  1. Run the TUI inside tmux 3.7+ (tmux new-session -A -s oc opencode).
  2. Record the pane output: tmux pipe-pane -t <pane> -o 'cat > /tmp/pane.bin'.
  3. Trigger an animated area (the working indicator / tab animation) and keep it running for ~10 s.
  4. 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anomalyco/opencode

Tutte le issue di anomalyco/opencode

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.