ttx 0.1.0
Loading...
Searching...
No Matches
ttx::terminal::OSC133 Struct Reference

Represents the explicit ending of a prompt. More...

#include <ttx/terminal/escapes/osc_133.h>

Public Member Functions

auto serialize () const -> di::String
 
auto operator== (OSC133 const &other) const -> bool=default
 

Static Public Member Functions

static auto parse (di::StringView data) -> di::Optional< OSC133 >
 

Public Attributes

di::Variant< BeginPrompt, EndPrompt, EndInput, EndCommandcommand
 

Friends

constexpr friend auto tag_invoke (di::Tag< di::reflect >, di::InPlaceType< OSC133 >)
 

Detailed Description

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.

Member Function Documentation

◆ operator==()

auto ttx::terminal::OSC133::operator== ( OSC133 const & other) const -> bool=default
default

◆ parse()

auto ttx::terminal::OSC133::parse ( di::StringView data) -> di::Optional<OSC133>
static

◆ serialize()

auto ttx::terminal::OSC133::serialize ( ) const -> di::String

Friends And Related Symbol Documentation

◆ tag_invoke

friend auto tag_invoke ( di::Tag< di::reflect > ,
di::InPlaceType< OSC133 >  )
friend

Member Data Documentation

◆ command

di::Variant<BeginPrompt, EndPrompt, EndInput, EndCommand> ttx::terminal::OSC133::command

The documentation for this struct was generated from the following files: