Skip to content

OSC 9;4 — Progress / Task State (ConEmu)

SequenceOSC 9 ; 4 ; <state> [; <value> [; <tag>]] ST
Otty support

Description

Reports the live state of a long-running task — a determinate percentage, an indeterminate spinner, or an error. ConEmu introduced this on the OSC 9 number with a leading 4 argument; it is a distinct sub-protocol from the OSC 9 desktop notification (the dispatcher branches on the 4; prefix).

Otty maps it to a tab badge and an animated Dock icon (other terminals route it to an OS taskbar bar). The full UX — auto-progress for known commands, otty watch, and the Settings toggles — lives in Progress State.

StateSequenceMeaning
0OSC 9;4;0Clear / no progress (resets to 0)
1OSC 9;4;1;<pct>In progress — <pct> is 0–100
2OSC 9;4;2[;<pct>]Error — optionally held at a percentage
3OSC 9;4;3Indeterminate — spinner, percentage unknown
4OSC 9;4;4[;<pct>]Paused / warning — ignored by Otty (no special reaction)
5OSC 9;4;5;<exit>[;watch]Otty extension — finished with exit code <exit>; the trailing watch tag marks a finish from otty watch so it routes to its own notification toggle

Example

bash
printf '\e]9;4;1;40\a'   # determinate — 40 %
printf '\e]9;4;3\a'      # indeterminate — spinner
printf '\e]9;4;2;80\a'   # error — held at 80 %
printf '\e]9;4;0\a'      # clear — remove the indicator

Try it

otty features try progress fires a determinate bar; otty features try error-state fires the error variant.

  • Progress State — tab badges, the Dock spinner, auto-progress commands, otty watch.
  • OSC 9 — desktop notification on the same OSC number (no leading 4).

Otty