OSC 9;4
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
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
| Parameter | Description | Default |
|---|---|---|
st | Progress state indicator | (required) |
pr | Progress percentage (0-100) | (required) |
The st (state) parameter controls the visual style of the progress indicator:
| State | Meaning | Description |
|---|---|---|
0 | Hidden | Remove/hide the progress indicator |
1 | Default | Normal progress (typically green) |
2 | Error | Error state (typically red) |
3 | Indeterminate | Busy/spinner state with no specific percentage |
4 | Warning | Warning 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
| Specification | Section |
|---|---|
| Windows Terminal Progress Bar | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✗ | No | Not listed in escape_support.md OSC section |
| Bobcat | ✓ | 0.9.6 | WhenProgress callback added in commit 2d4399a |
| contour | ✓ | v0.6.2.8008 | Progress reporting via OSC 9;4 (ConEmu format) |
| foot | ✗ | No | ConEmu/Windows Terminal progress explicitly ignored in osc.c:1389 |
| Ghostty | ✓ | v1.0.0 | |
| iTerm2 | ✗ | No | Not found in codebase |
| Kitty | ✗ | No | OSC 9;4 progress reporting explicitly discarded per changelog |
| Konsole | ✓ | Yes | ConEmu OSC 9;4 progress reporting in src/Vt102Emulation.cpp:1825-1851 |
| mintty | ✓ | Yes | Implemented at termout.c:5149-5220, progress reporting (OSC 9;4) |
| mlterm | ✗ | No | |
| PuTTY | ✗ | No | Not implemented in do_osc function |
| Rio | ✗ | No | |
| rxvt-unicode | ✗ | No | |
| st | ✗ | No | |
| terminology | ✗ | No | |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | OSC 9;4 progress reporting handled via conemu_extension |
| WezTerm | ✓ | Yes | OSC 9;4 ConEmuProgress for progress reporting - see wezterm-escape-parser/src/osc.rs:52,319-347,608-612 |
| Windows Terminal | ✓ | Yes | DoConEmuAction subParam 4 calls SetTaskbarProgress for progress reporting |
| xterm | ✗ | No | No evidence in documentation or source code |
| xterm.js | ✓ | 6.0.0 | Requires addon-progress |
| Multiplexers | |||
| cy | ✗ | No | |
| GNU Screen | ✗ | No | |
| tmux | ✗ | No | Progress reporting not implemented |
| tuios | ✗ | No | |
| Zellij | ✗ | No | |
See also
- OSC 9 — Desktop Notification — The parent ConEmu notification protocol