[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.
This commit is contained in:
Charles Zablit 2026-04-02 15:08:52 +01:00 committed by GitHub
parent 5226289b8e
commit 29c083a61f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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');