Repository navigation
Conversation
On Windows, portable-pty resolves conpty.dll through the standard DLL search order, which includes PATH. When a terminal such as WezTerm is on PATH, its bundled conpty.dll gets sideloaded instead of the system ConPTY and can break PTY creation. Temporarily strip PATH entries that contain a conpty.dll while calling openpty so the system ConPTY is preferred, guarded by a global mutex and restored via RAII on drop. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Collaborator
|
Hi @Melser, thanks for your interest in contributing! New contributors need maintainer approval before opening PRs. This keeps review time focused on accepted work and avoids wasted effort. Herdr is opinionated about how it should look, feel, and work. Feature requests, ideas, questions, contribution proposals, and product-direction checks belong in Discussions, not issues. Next steps:
A discussion, issue, branch, or proposed implementation does not reserve the work and does not mean the PR path is approved. This PR will be closed automatically. See https://github.com/ogulcancelik/herdr/blob/master/CONTRIBUTING.md for more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows,
portable-ptyloadsconpty.dlldynamically using the standard DLL search order, which includesPATH. When a terminal such as WezTerm is onPATH, its bundledconpty.dllgets sideloaded instead of the system ConPTY, which can break PTY creation in herdr's panes.This change temporarily removes any
PATHdirectory that contains aconpty.dllwhile callingopenpty, so the system ConPTY is preferred. The originalPATHis restored immediately afterward.Implementation
openpty_preferring_system_conptywrapsnative_pty_system().openpty(...).ConptyPathGuard(RAII) strips offendingPATHentries on install and restores the originalPATHon drop — even on panic.Mutexserializes thePATHmutation becausePATHis process-global shared state and concurrent spawns would otherwise race.Tests
Added Windows-only unit tests verifying the
PATHfilter removes directories containingconpty.dlland preserves directories without it.🤖 Generated with Claude Code