Skip to content

fix: Windows async mode and Chinese encoding (#127)#129

Merged
bfly123 merged 1 commit intobfly123:mainfrom
LeoLin990405:fix/windows-async-encoding
Mar 11, 2026
Merged

fix: Windows async mode and Chinese encoding (#127)#129
bfly123 merged 1 commit intobfly123:mainfrom
LeoLin990405:fix/windows-async-encoding

Conversation

@LeoLin990405
Copy link
Contributor

Summary

Fixes #127 — Windows async mode (ask codex "message") fails silently and Chinese characters display as garbled text.

Root causes:

  • Windows PowerShell background script was missing CCB_RUN_DIR env var, so the async task couldn't locate the askd daemon state file
  • UTF-8 encoding setup was incomplete — only [Console]::OutputEncoding was set, missing $OutputEncoding, [Console]::InputEncoding, and $env:PYTHONIOENCODING
  • CCB_EMAIL_* env vars were not forwarded to the background script (Unix had this, Windows didn't)

Changes:

  • bin/ask: Add CCB_RUN_DIR, full UTF-8 encoding, and CCB_EMAIL_* to Windows PowerShell script — achieving parity with Unix
  • test/test_windows_compat.py: 10 new tests verifying Windows/Unix feature parity

Test plan

  • pytest test/test_windows_compat.py -v — 10 passed
  • Manual: ask codex "test message" on Windows (async mode)
  • Manual: ask codex "中文测试" on Windows (Chinese encoding)

…pt (bfly123#127)

The Windows PowerShell background script was missing CCB_RUN_DIR env var
(causing async mode to fail) and proper UTF-8 encoding setup (causing
Chinese character garbling). Also adds CCB_EMAIL_* env var forwarding
for email caller parity with Unix.
@bfly123 bfly123 merged commit cb33b2c into bfly123:main Mar 11, 2026
3 of 13 checks passed
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.

ccb 兼容window 环境的问题

2 participants