[Lldb-commits] [lldb] 29c083a - [lldb][windows] simplify the ConPTY draining subprocess (#190178)

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 2 07:08:56 PDT 2026


Author: Charles Zablit
Date: 2026-04-02T15:08:52+01:00
New Revision: 29c083a61f2e2d821e339d7b370d0d4e5e8d7594

URL: https://github.com/llvm/llvm-project/commit/29c083a61f2e2d821e339d7b370d0d4e5e8d7594
DIFF: https://github.com/llvm/llvm-project/commit/29c083a61f2e2d821e339d7b370d0d4e5e8d7594.diff

LOG: [lldb][windows] simplify the ConPTY draining subprocess (#190178)

In some environments like swiftlang, the `''` causes the command used to
drain the init sequence of the ConPTY to fail. Replacing with a `cls`
invocation removes the need for quotation marks and works just as well.

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 7c5818c03e37f..bf11a08cc1b85 100644
--- a/lldb/source/Host/windows/PseudoConsole.cpp
+++ b/lldb/source/Host/windows/PseudoConsole.cpp
@@ -252,7 +252,7 @@ llvm::Error PseudoConsole::DrainInitSequences() {
         std::error_code(GetLastError(), std::system_category()),
         "Failed to get the 'COMSPEC' environment variable");
 
-  std::wstring cmdline_str = std::wstring(comspec) + L" /c 'echo foo && exit'";
+  std::wstring cmdline_str = std::wstring(comspec) + L" /c cls";
   std::vector<wchar_t> cmdline(cmdline_str.begin(), cmdline_str.end());
   cmdline.push_back(L'\0');
 


        


More information about the lldb-commits mailing list