LLDB mainline
ConnectionConPTYWindows.cpp File Reference

Go to the source code of this file.

Functions

static void StripConPTYSequences (void *data, size_t &len, bool strip_init)
 Remove ConPTY management sequences from a buffer in-place.

Function Documentation

◆ StripConPTYSequences()

void StripConPTYSequences ( void * data,
size_t & len,
bool strip_init )
static

Remove ConPTY management sequences from a buffer in-place.

ConPTY injects several VT sequences into its output pipe that are not part of the inferior's output: a cursor-position query (\x1b[6n) emitted during PSEUDOCONSOLE_INHERIT_CURSOR initialisation, Win32 Input Mode toggles (\x1b[?9001h/l), focus-event toggles (\x1b[?1004h/l), and a window-title OSC sequence (\x1b]0;...\x07). These sequences must not reach the outer terminal.

Parameters
[in,out]dataBuffer containing raw ConPTY output.
[in,out]lenOn entry, the number of valid bytes in data. Updated to the number of bytes after stripping.
[in]strip_initIf true, also strip init-only sequences (\x1b[m, \x1b[?25h) that ConPTY emits at startup.

Definition at line 32 of file ConnectionConPTYWindows.cpp.

Referenced by lldb_private::ConnectionConPTY::Read().