Skip to main content

Synchronized output

AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Experimental

Synchronized Output (Mode 2026) is a DECSET/DECRST mode that allows applications to bracket a batch of output so the terminal can render it atomically, preventing partial-frame artifacts (tearing).

Syntax​

CSI ? 2026 h    DECSET — Begin synchronized update
CSI ? 2026 l DECRST — End synchronized update
Formal syntax
DECSET-mode2026 = 0x1b, "[", "?", "2", "0", "2", "6", "h" ;
DECRST-mode2026 = 0x1b, "[", "?", "2", "0", "2", "6", "l" ;

Description​

Mode 2026 provides a mechanism for tear-free rendering in terminal applications. By bracketing output between a begin and end marker, the application signals that all output in between should be presented to the user as a single atomic update.

  • Set (begin) — The terminal begins buffering output instead of rendering it immediately.
  • Reset (end) — The terminal renders all buffered output at once, producing a single, complete frame.

The tearing problem​

Without synchronized output, terminal emulators typically render output as it arrives. When an application performs a complex screen update (clearing regions, repositioning the cursor, writing new content), the user may briefly see intermediate states where parts of the old and new content are visible simultaneously. This is known as "tearing" or "flicker."

How it works​

  1. The application sends CSI ? 2026 h to begin the synchronized update
  2. The application sends all the escape sequences and text needed to draw the new frame
  3. The application sends CSI ? 2026 l to end the synchronized update
  4. The terminal renders the entire buffered output at once

Timeout behavior​

Terminals typically implement a safety timeout (commonly around 1 second) to prevent indefinite buffering if the end marker is never received. If the timeout expires, the terminal renders whatever has been buffered so far and exits synchronized mode.

Advantages over alternatives​

Before Mode 2026, applications used various workarounds to reduce tearing:

  • Hidden cursor — Hiding the cursor during updates reduces visual artifacts but doesn't prevent partial content from being shown
  • Double buffering — Some terminal frameworks maintain their own off-screen buffer and compute minimal diffs, but this adds complexity
  • Rate limiting — Throttling output reduces tearing at the cost of responsiveness

Mode 2026 is the cleanest solution because it gives the terminal explicit knowledge of frame boundaries.

note

Mode 2026 can be nested in some implementations, but applications should avoid relying on nesting behavior. A single begin/end pair per frame update is the expected pattern.

Examples​

# Perform a tear-free screen update:
printf '\e[?2026h' # Begin synchronized update
printf '\e[2J\e[H' # Clear screen, move home
printf 'Line 1\n'
printf 'Line 2\n'
printf 'Line 3\n'
printf '\e[?2026l' # End — terminal renders everything at once

# In a render loop (pseudocode):
# while true:
# printf '\e[?2026h'
# draw_frame()
# printf '\e[?2026l'
# sleep(1/60)

Specifications​

SpecificationSection
Synchronized Output—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✓YesAcknowledged but no-op per code
Bobcat??Not explicitly configured in Bobcat. TerminalCtrl may support this, but cannot confirm from Bobcat's code.
contour✓v0.3.0.198Implemented as DECMode::BatchedRendering at primitives.h:713, handled in Terminal.cpp:2330
foot✓1.9.0
Ghostty✓v1.0.0
iTerm2✓v20260216-nightly
Kitty✓YesImplemented as PENDING_UPDATE mode
Konsole✓YesMODE_SynchronizedUpdate implemented
mintty✓YesImplemented at src/termout.c:2622
mlterm✗No
PuTTY✗No
Rio✓v0.1.13
rxvt-unicode✗No
st✗No
terminology✗No
VT100✗No
VTE✗NoCommented TODO in vteseq.cc:9820
WezTerm✓YesHandled in mux layer
Windows Terminal✓YesSO_SynchronizedOutput at adaptDispatch.cpp:1879-1885
xterm✗No
xterm.js✓6.0.0
Multiplexers
cy✓v1.11.0
GNU Screen✗No
tmux✓YesAdded after 3.6a, will be in next release
tuios✗No
Zellij✓v0.40.0

See also​