Represents the explicit ending of a prompt.
When this isn't specified, it is assumed that the prompt ends at the end of the next line.
Represents a semantic prompt command
This protocal is useful for shell integration with terminals, specified here.
This implementation deviates from the protocol to align with other terminals (iTerm, ghostty, and kitty), while do not implement the full set of commands specified. Instead, only "A", "B", "C", and "D" are implemented. Additionally, the "fresh-line" part of the spec is ignored because with the removal of the "P" command, there would be no way to specify a "right" prompt without creating a new line. Other terminals also don't create a fresh-line with the "A" command. Also, a "fresh-line" can be emulated by simply outputting N space characters, followed by \r, and then clearing the line, where N is the terminal width (which appears to be what zsh does).
Additionally, the prompt begin command supports the "redraw" option, which defaults to true, and indicates whether or not the shell redraws the prompt on resize. If the shell does redraw the prompt, when resizing the screen, all text below and including the current prompt is cleared.