[Lldb-commits] [lldb] [lldb][windows] only use a ConPTY if needed (PR #172877)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 18 08:34:38 PST 2025


https://github.com/charles-zablit created https://github.com/llvm/llvm-project/pull/172877

This patch fixes a regression caused by https://github.com/llvm/llvm-project/pull/168729.

The changes ensure that we only create the process with a ConPTY if we need to.

>From 7155015ed1e3aa78d80851129ad05fb94ebceb1d Mon Sep 17 00:00:00 2001
From: Charles Zablit <c_zablit at apple.com>
Date: Thu, 18 Dec 2025 16:25:26 +0000
Subject: [PATCH] [lldb][windows] only use a ConPTY if needed

---
 lldb/source/Host/windows/ProcessLauncherWindows.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lldb/source/Host/windows/ProcessLauncherWindows.cpp b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
index ae79171337726..4cfe6f3394be9 100644
--- a/lldb/source/Host/windows/ProcessLauncherWindows.cpp
+++ b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
@@ -93,8 +93,9 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info,
   startupinfoex.StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
 
   HPCON hPC = launch_info.GetPTY().GetPseudoTerminalHandle();
-  bool use_pty =
-      hPC != INVALID_HANDLE_VALUE && launch_info.GetNumFileActions() == 0;
+  bool use_pty = hPC != INVALID_HANDLE_VALUE &&
+                 launch_info.GetNumFileActions() == 0 &&
+                 launch_info.GetFlags().Test(lldb::eLaunchFlagLaunchInTTY);
 
   HANDLE stdin_handle = GetStdioHandle(launch_info, STDIN_FILENO);
   HANDLE stdout_handle = GetStdioHandle(launch_info, STDOUT_FILENO);



More information about the lldb-commits mailing list