Expand description
Shell-integration prompt and command markers using OSC 133.
§Category
OSC 133 marks prompt start, command input start, command execution, and command completion. Terminals can use these markers to segment scrollback.
§OSC framing
Writers use 7-bit OSC with BEL termination: ESC ] 133 ; <mark> [;data] BEL.
write_finalterm is the generic form; the other functions encode the
standard A, B, C, and D markers.
§Mode interaction
These markers are not controlled by a DECSET mode. They are passive metadata embedded in the output stream.
Functions§
- write_
command_ executed - Mark the moment command execution begins with exact bytes
ESC ] 133 ; C BEL. - write_
command_ finished - Mark command completion with
ESC ] 133 ; D [;exit-code] BEL. - write_
command_ start - Mark the end of the prompt and start of command input with exact bytes
ESC ] 133 ; B BEL. - write_
finalterm - Emit a generic OSC 133 marker,
ESC ] 133 [;<param>...] BEL. - write_
prompt_ start - Mark the start of a prompt with exact bytes
ESC ] 133 ; A BEL.