================
@@ -133,3 +137,52 @@ void PseudoConsole::Close() {
m_conpty_input = INVALID_HANDLE_VALUE;
m_conpty_output = INVALID_HANDLE_VALUE;
}
+
+llvm::Error PseudoConsole::DrainInitSequences() {
+ STARTUPINFOEXW startupinfoex = {};
+ startupinfoex.StartupInfo.cb = sizeof(STARTUPINFOEXW);
+ startupinfoex.StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
+
+ auto attributelist_or_err = ProcThreadAttributeList::Create(startupinfoex);
+ if (!attributelist_or_err)
+ return llvm::errorCodeToError(attributelist_or_err.getError());
+ ProcThreadAttributeList attributelist = std::move(*attributelist_or_err);
+ if (auto error = attributelist.SetupPseudoConsole(m_conpty_handle))
+ return error;
+
+ PROCESS_INFORMATION pi = {};
+ wchar_t cmdline[] = L"cmd.exe /c 'echo foo && exit'";
----------------
charles-zablit wrote:
Fixed, thanks! If we don't find the variable, this is not a fatal error and
it's only logged.
https://github.com/llvm/llvm-project/pull/175812
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits