[ConPTY] Avoid screen clear when starting process #19953
Replies: 3 comments
|
The |
|
The previous answer on this thread is correct. But... if you're going to give the spawned subprocess access to the console, why not just run it with standard console inheritance? Does |
|
Thanks for the answers! To add more details: From my understanding, lldb cannot use standard console inheritance because we could not control how the output of lldb and the output of the debuggee would overlap. At the time, this was also for architecture reasons, to match what is already implemented in lldb on other platforms than Windows. |
Uh oh!
There was an error while loading. Please reload this page.
In LLDB, we've been moving towards using the ConPTY to show the output of processes inline instead of a new console window:
When starting the process and reading from the PTY, we always get the VT init-sequence that clears the screen and sets the window title (from the
EchoConexample):\u{1b}[?9001h: enable win32-input-mode\u{1b}[?1004h: send Focus In/Out events\u{1b}[?25l: hide cursor\u{1b}[2J: selective erase all\u{1b}[m: set default character attributes (VT100)\u{1b}[H: set cursor to (1,1)\u{1b}]0;C:\\WINDOWS\\SYSTEM32\\ping.exe\u{7}: set window title\u{1b}[?25h: show cursor\u{1b}[?9001l: disable win32-input-mode\u{1b}[?1004h: don't send Focus In/Out eventsFor LLDB, we'd like to avoid parts of the init sequence - we want to show the output of the process directly after the
(lldb) rprompt. Our current solution is to filter out the sequence when starting the process.If LLDB does not strip the init sequence, after the user runs the debuggee (
rcommand), this is what the console window looks like:Before running
After running
The
(lldb) rprompt is overwritten.Running the debuggee should not clear the screen, instead the screen should look like this:
Before running
After running
Would it be possible to tell the pseudo-console API which parts we'd like to get or to omit some parts?
All reactions