Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#60,584 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
65/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
cli

調査の方向性

まず、issueで説明されているTUIレンダラーの設定とターミナルセッションモードの解決方法を読み、その後、レンダラーのオプションがユーザーにどのように公開されているかをたどってください。ユーザーがauto、always、neverを選択でき、選択したモードがtmux内の同期出力マーカーを制御できれば完了です。issueにはマーカーを確認するためのキャプチャコマンドが記載されています。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
221k
フォーク
29.6k
平均マージ
7時間 19分
マージ済み PR(30日)
504

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。