[Lldb-commits] [lldb] 214246e - [lldb][windows] fix VT sequences overriding (lldb) prompt (#183366)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Mar 6 09:06:12 PST 2026
Author: Charles Zablit
Date: 2026-03-06T18:06:07+01:00
New Revision: 214246ea7936d0d4df1e76f0cfc33a0d3a33224b
URL: https://github.com/llvm/llvm-project/commit/214246ea7936d0d4df1e76f0cfc33a0d3a33224b
DIFF: https://github.com/llvm/llvm-project/commit/214246ea7936d0d4df1e76f0cfc33a0d3a33224b.diff
LOG: [lldb][windows] fix VT sequences overriding (lldb) prompt (#183366)
This patch fixes the `(lldb)` prompt being overwriten by the cursor
position movements the ConPTY emits.
To be a complete solution we should also add a resize hook for the
console's window.
I also think that we should look into injecting conpty VT sequences
before printing the `(lldb)` prompt.
For instance, if we break on a breakpoint and the pty added a "hide
cursor" VT sequence, we should emit a `show cursor` sequence before
printing `(lldb)`. This should be done outside of this PR however.
Added:
Modified:
lldb/source/Host/windows/PseudoConsole.cpp
Removed:
################################################################################
diff --git a/lldb/source/Host/windows/PseudoConsole.cpp b/lldb/source/Host/windows/PseudoConsole.cpp
index da4b1310ea17c..b8b74091fe474 100644
--- a/lldb/source/Host/windows/PseudoConsole.cpp
+++ b/lldb/source/Host/windows/PseudoConsole.cpp
@@ -101,6 +101,11 @@ llvm::Error PseudoConsole::OpenPseudoConsole() {
std::error_code(GetLastError(), std::system_category()));
COORD consoleSize{80, 25};
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+ if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi))
+ consoleSize = {
+ static_cast<SHORT>(csbi.srWindow.Right - csbi.srWindow.Left + 1),
+ static_cast<SHORT>(csbi.srWindow.Bottom - csbi.srWindow.Top + 1)};
HPCON hPC = INVALID_HANDLE_VALUE;
hr = kernel32.CreatePseudoConsole(consoleSize, hInputRead, hOutputWrite, 0,
&hPC);
More information about the lldb-commits
mailing list