Skip to content

fix(windows): bidirectional pty compat for all conpty.node variants#983

Merged
web3dev1337 merged 1 commit intomainfrom
fix/windows-pty-bidirectional-compat
Mar 21, 2026
Merged

fix(windows): bidirectional pty compat for all conpty.node variants#983
web3dev1337 merged 1 commit intomainfrom
fix/windows-pty-bidirectional-compat

Conversation

@web3dev1337
Copy link
Owner

Summary

  • The runtime node-pty compat shim previously only handled "too many args" (strip useConptyDll when native doesn't want it)
  • On some Windows machines, the bundled conpty.node binary expects MORE args than the JS wrapper sends — the opposite direction
  • This caused Commander and worktree terminals to fail with Usage: pty.startProcess(file, cols, rows, debug, pipeName, inheritCursor, useConptyDll)
  • Now handles both directions for all wrapped methods:
    • startProcess: 7→6 (existing) AND 6→7 (append false)
    • connect: 6→5 (existing) AND 5→6 (insert false before callback)
    • resize/clear/kill: parses expected arg count from usage error message, pads or strips accordingly
  • 3 new test cases covering the "too few args" scenarios
  • All 545 tests pass

Test plan

  • Test on machine where Commander previously worked (should still work)
  • Test on machine where Commander was broken with Usage: pty.startProcess(...useConptyDll) error
  • Test on third machine that had neither variant working
  • Verify worktree terminal creation works on all machines

🤖 Generated with Claude Code

…arg count

The runtime compat previously only handled the case where the JS wrapper
sent MORE args than the native conpty.node expected (7→6 for startProcess,
6→5 for connect). On some Windows machines, the native binary expects MORE
args than the JS sends (e.g. requires useConptyDll as 7th arg). This caused
Commander and worktree terminals to fail on those machines.

Now handles both directions:
- startProcess: 7→6 (strip useConptyDll) AND 6→7 (append false)
- connect: 6→5 (strip useConptyDll) AND 5→6 (insert false before callback)
- resize/clear/kill: parse expected arg count from usage error, pad or strip

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@web3dev1337 web3dev1337 merged commit b8877a0 into main Mar 21, 2026
5 checks passed
@web3dev1337 web3dev1337 mentioned this pull request Mar 21, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant