Write an OSC <command>;<payload> sequence.
The numeric OSC command (e.g. "9;4" for taskbar progress).
Optional semicolon-joined payload appended after the command.
When True, terminate with String Terminator (ESC \) instead of
the default BEL (\a).
BEL matches the Windows Terminal docs and works on most terminals; VTE-derived terminals may prefer ST.