Skip to main content

Module finalterm

Module finalterm 

Source
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.