Skip to main content

OSC 9;4

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

OSC 9;4 reports task progress to the terminal, which can display it as a progress indicator in the taskbar, tab bar, or title bar. This enables build tools, package managers, and other long-running commands to provide visual progress feedback.

Syntax​

OSC 9 ; 4 ; st ; pr ST
OSC 9 ; 4 ; st ; pr BEL
Formal syntax
OSC9_4 = 0x1b, "]", "9", ";", "4", ";", state, ";", progress, ( 0x07 | 0x1b, "\\" ) ;
state    = "0" | "1" | "2" | "3" | "4" ;
progress = digit, { digit } ;
digit    = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;

Parameters​

ParameterDescriptionDefault
stProgress state indicator(required)
prProgress percentage (0-100)(required)

The st (state) parameter controls the visual style of the progress indicator:

StateMeaningDescription
0HiddenRemove/hide the progress indicator
1DefaultNormal progress (typically green)
2ErrorError state (typically red)
3IndeterminateBusy/spinner state with no specific percentage
4WarningWarning state (typically yellow)

Description​

Per the Windows Terminal documentation, OSC 9;4 is a sub-command of the ConEmu OSC 9 protocol that allows applications to report progress to the terminal. The terminal can then display this progress in its taskbar button (on Windows), tab bar, or other UI elements.

This mechanism is particularly useful for:

  • Build systems reporting compilation progress
  • Package managers showing download/install progress
  • File operations like copying or compressing large files
  • CI/CD tools indicating pipeline stage progress

The progress indicator is typically shown in the operating system's taskbar. On Windows, this appears as a progress bar overlay on the terminal's taskbar icon. On other platforms, the rendering depends on the terminal emulator's implementation.

Setting the state to 0 (hidden) clears the progress indicator and returns the taskbar/tab to its normal appearance.

Examples​

# Show 50% progress in default (green) state
printf '\e]9;4;1;50\a'

# Show completed progress
printf '\e]9;4;1;100\a'

# Show error state at 75%
printf '\e]9;4;2;75\a'

# Show indeterminate/busy state
printf '\e]9;4;3;0\a'

# Show warning at 30%
printf '\e]9;4;4;30\a'

# Clear the progress indicator
printf '\e]9;4;0;0\a'

# Simulate a progress bar for a loop
for i in $(seq 1 100); do
printf '\e]9;4;1;%d\a' "$i"
sleep 0.05
done
printf '\e]9;4;0;0\a'

Specifications​

SpecificationSection
Windows Terminal Progress Bar—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✗NoNot listed in escape_support.md OSC section
Bobcat✓0.9.6WhenProgress callback added in commit 2d4399a
contour✓v0.6.2.8008Progress reporting via OSC 9;4 (ConEmu format)
foot✗NoConEmu/Windows Terminal progress explicitly ignored in osc.c:1389
Ghostty✓v1.0.0
iTerm2✗NoNot found in codebase
Kitty✗NoOSC 9;4 progress reporting explicitly discarded per changelog
Konsole✓YesConEmu OSC 9;4 progress reporting in src/Vt102Emulation.cpp:1825-1851
mintty✓YesImplemented at termout.c:5149-5220, progress reporting (OSC 9;4)
mlterm✗No
PuTTY✗NoNot implemented in do_osc function
Rio✗No
rxvt-unicode✗No
st✗No
terminology✗No
VT100✗No
VTE✓YesOSC 9;4 progress reporting handled via conemu_extension
WezTerm✓YesOSC 9;4 ConEmuProgress for progress reporting - see wezterm-escape-parser/src/osc.rs:52,319-347,608-612
Windows Terminal✓YesDoConEmuAction subParam 4 calls SetTaskbarProgress for progress reporting
xterm✗NoNo evidence in documentation or source code
xterm.js✓6.0.0Requires addon-progress
Multiplexers
cy✗No
GNU Screen✗No
tmux✗NoProgress reporting not implemented
tuios✗No
Zellij✗No

See also​