Skip to content

Background color query (OSC 11)

Category: extensions · Tags: Operating System Commands (OSC), Xterm Extensions · Specification ↗

OSC 11 queries the terminal's default background color. The query is ESC ] 11 ; ? ST. The response format matches OSC 10. This is the most reliable way to detect whether the user has a dark or light terminal theme — compare the background color's luminance to determine the appropriate color palette.

Supported by 6 of 6 backends (100%)

Support Matrix

BackendVersionSupportNotes
Alacritty0.26.0✓ yes
Ghostty1.3.1✓ yes
Kitty0.40.0✓ yes
vt1000.1.0✓ yes
WezTerm0.1.0-fork.5✓ yes
xterm.js5.5.0✓ yes

Powered by Termless
Playwright for Terminals