wire / terminal-osc / 133
OSC 133 marks shell prompt, command-input, and command-output boundaries so terminals can navigate by command, fold output, and color the prompt by exit status. Four subcommands: A (prompt start), B (command-line start), C (output start), D[;exitcode] (command finished). Originated in the defunct FinalTerm emulator; harmonized by Per Bothner's Semantic Prompts proposal; near-universally adopted.
aka: FTCS · FinalTerm prompt markers · FinalTerm sequences · semantic prompts · shell integration marks · FTCS_PROMPT/FTCS_COMMAND_START/FTCS_COMMAND_EXECUTED/FTCS_COMMAND_FINISHED
OSC introducer: \x1b] ESC ] (0x1B 0x5D)
terminator (ST|BEL): ST \x1b\ · BEL \x07
| id | name | bytes (ST) | meaning |
|---|---|---|---|
| A | FTCS_PROMPT | \x1b]133;A\x1b\ | Start of the prompt. Emitted by the shell precmd hook just before printing PS1. |
| B | FTCS_COMMAND_START | \x1b]133;B\x1b\ | Start of the command line / end of the prompt. Everything after this until C is what the user typed. |
| C | FTCS_COMMAND_EXECUTED | \x1b]133;C\x1b\ | Start of command output / end of the command line. Emitted from the shell preexec hook, just before the command runs. |
| D | FTCS_COMMAND_FINISHED | \x1b]133;D\x1b\ | End of the command. Optional exit code as a second parameter: 0 = success, nonzero = error. Omitting the exit code leaves the mark default-colored (no success/error tint). |
| terminal | level | since | notes |
|---|---|---|---|
| FinalTerm | full | original (defunct) | Origin of the FTCS sequences; project is defunct but documented by iTerm2. |
| iTerm2 | full | Shell Integration (3.x) | Documents the sequences; also defines its own OSC 1337 family for additional shell-integration features. |
| VTE / GNOME Terminal | full | VTE 0.66+ | Recognizes OSC 133 A/B/C/D for prompt/command tracking. |
| WezTerm | full | documented | Implements semantic zones from OSC 133; documents shell integration. |
| kitty | full | documented | Uses OSC 133 for shell integration / command tracking. |
| Ghostty | full | 1.0 | Supports OSC 133 shell integration out of the box. |
| Windows Terminal | full | stable shell-integration tutorial | Documents A/B/C/D identically to Contour; supports D exit-code coloring. |
| Contour | full | documented | Dedicated OSC-133 shell-integration page; authoritative cross-source for A/B/C/D. |
| VS Code integrated terminal | variant | shell integration | Prefers OSC 633 (superset) but also accepts/emits OSC 133 for portability. |
| Warp | partial | documented | Block model derives from prompt/command boundaries; uses shell-integration marks though its native model predates a pure 133 dependency. |
| DomTerm | full | Per Bothner ref impl | Reference implementation behind the Semantic Prompts proposal. |
per-fact attribution:
agent: curl -H 'accept: application/json' wire.phall.io/terminal-osc/133
or /terminal-osc/133.json