From 8afd52ae57f9237f4f46138ad224dfc621d7ba59 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Sat, 25 Jul 2026 02:40:14 +0300 Subject: fix: bundle modern ConPTY on Windows (#1828) refs #1533 refs #1644 --- scripts/test_vendor_portable_pty.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'scripts/test_vendor_portable_pty.py') diff --git a/scripts/test_vendor_portable_pty.py b/scripts/test_vendor_portable_pty.py index 87537d41..cf3b791a 100644 --- a/scripts/test_vendor_portable_pty.py +++ b/scripts/test_vendor_portable_pty.py @@ -103,13 +103,22 @@ class VendorPortablePtyTests(unittest.TestCase): f"stderr:\n{result.stderr}", ) - def test_windows_conpty_loader_does_not_probe_path_conpty_dll(self) -> None: + def test_windows_conpty_loader_uses_only_controlled_sources(self) -> None: project_root = Path(__file__).resolve().parent.parent source = project_root / "vendor" / "portable-pty" / "src" / "win" / "psuedocon.rs" text = source.read_text() - self.assertIn('ConPtyFuncs::open(Path::new("kernel32.dll"))', text) + self.assertIn("std::env::current_exe()", text) + self.assertIn('.join("conpty")', text) + self.assertIn('"x64/OpenConsole.exe"', text) + self.assertIn('"arm64/OpenConsole.exe"', text) + self.assertIn("LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR", text) + self.assertIn("LOAD_LIBRARY_SEARCH_SYSTEM32", text) + self.assertIn("GetModuleHandleW", text) + self.assertIn("HERDR_WINDOWS_CONPTY", text) + self.assertIn("Sha256::new()", text) self.assertNotIn('Path::new("conpty.dll")', text) + self.assertNotIn("shared_library", text) if __name__ == "__main__": -- cgit v1.2.3