Skip to content

fix: support local bash on Windows - #272

Draft
ruirui6946 wants to merge 1 commit into
TencentCloudADP:mainfrom
ruirui6946:agent/fix-windows-pexpect
Draft

fix: support local bash on Windows#272
ruirui6946 wants to merge 1 commit into
TencentCloudADP:mainfrom
ruirui6946:agent/fix-windows-pexpect

Conversation

@ruirui6946

Copy link
Copy Markdown

Summary

  • use pexpect's cross-platform PopenSpawn backend for cmd.exe on Windows
  • disable command echo and return the initialized Windows shell just like the Unix branch
  • add a regression test for Windows shell selection and prompt setup

Closes #25.

Why

pexpect.spawn is unavailable on Windows, so constructing the local Bash toolkit raised AttributeError. The Windows branch also fell through without returning the child process and prompt.

Validation

  • .venv/Scripts/pytest.exe -q tests/tools/test_bash_pexpect_windows.py
  • .venv/Scripts/ruff.exe check utu/tools/local_env/bash_pexpect.py tests/tools/test_bash_pexpect_windows.py
  • .venv/Scripts/ruff.exe format --check utu/tools/local_env/bash_pexpect.py tests/tools/test_bash_pexpect_windows.py
  • Windows smoke test: PexpectBash(timeout=5).run("echo hello")

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.

pexpect.spawn not available on Windows – Consider Alternative for Cross-Platform Compatibility

1 participant